Georg\'s last patch for bug 605

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8627 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2004-04-08 10:09:09 +00:00
parent 839b13d5d0
commit b3bed8d879
6 changed files with 33 additions and 7 deletions

View File

@ -187,7 +187,6 @@ src/output_plaintext.C
src/paragraph.C
src/rowpainter.C
src/support/globbing.C
src/tex2lyx/lengthcommon.C
src/text.C
src/text2.C
src/text3.C

View File

@ -1,4 +1,8 @@
2004-04-01 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* LaTeXFeatures.[Ch]: change buffer_ to a pointer and add accessor
setBuffer()
2004-04-07 Alfredo Braunstein <abraunst@lyx.org>
* BufferView.C (setCursor): call redoParagraph (some insets could

View File

@ -43,7 +43,7 @@ using std::set;
LaTeXFeatures::LaTeXFeatures(Buffer const & b, BufferParams const & p, bool n)
: buffer_(b), params_(p), nice_(n)
: buffer_(&b), params_(p), nice_(n)
{}
@ -465,7 +465,13 @@ void LaTeXFeatures::showStruct() const {
Buffer const & LaTeXFeatures::buffer() const
{
return buffer_;
return *buffer_;
}
void LaTeXFeatures::setBuffer(Buffer const & buffer)
{
buffer_ = &buffer;
}

View File

@ -79,6 +79,8 @@ public:
///
Buffer const & buffer() const;
///
void setBuffer(Buffer const &);
///
BufferParams const & bufferParams() const;
/// the return value is dependent upon both LyXRC and LaTeXFeatures.
bool useBabel() const;
@ -106,8 +108,12 @@ private:
typedef std::map<std::string , std::string> FileMap;
///
FileMap IncludedFiles_;
///
Buffer const & buffer_;
/** Buffer of the file being processed.
* This may be a child buffer of the to-be-exported file and
* therefore may not be the buffer that belongs to params_.
* Only needed by InsetInclude::validate().
*/
Buffer const * buffer_;
///
BufferParams const & params_;
/** If we are writing a nice LaTeX file or not.

View File

@ -1,3 +1,8 @@
2004-04-01 Georg Baum <Georg.Baum@post.rwth-aachen.de>
* insetinclude.C (validate): set/reset features.buffer_ when
validating the child
2004-04-07 Angus Leeming <angus@localhost.localdomain>
* insetexternal.C (priv_dispatch):
@ -15,7 +20,7 @@
* ExternalSupport.C (doSubstitution): add new variables $$AbsPath,
$$RelPath_Master, $$RelPath_Parent, $$Extension,
$$AbsOrRelPath_Master and $$AbsOrRelPath_Parent. Change the meaning
$$AbsOrRelPathMaster and $$AbsOrRelPathParent. Change the meaning
of $$Basename
* ExternalSupport.C (updateExternal): use absolute and output
filename where appropriate

View File

@ -530,8 +530,14 @@ void InsetInclude::validate(LaTeXFeatures & features) const
if (loadIfNeeded(buffer, params_)) {
// a file got loaded
Buffer * const tmp = bufferlist.getBuffer(included_file);
if (tmp)
if (tmp) {
// We must temporarily change features.buffer,
// otherwise it would always be the master buffer,
// and nested includes would not work.
features.setBuffer(*tmp);
tmp->validate(features);
features.setBuffer(buffer);
}
}
}