]> git.lyx.org Git - features.git/commitdiff
Georg\'s last patch for bug 605
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 8 Apr 2004 10:09:09 +0000 (10:09 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Thu, 8 Apr 2004 10:09:09 +0000 (10:09 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8627 a592a061-630c-0410-9148-cb99ea01b6c8

po/POTFILES.in
src/ChangeLog
src/LaTeXFeatures.C
src/LaTeXFeatures.h
src/insets/ChangeLog
src/insets/insetinclude.C

index 1aaecd8ae3213ced51787126f35f87b740816e1d..2f914c23428f517e53f79bc0435fb690db33cc4a 100644 (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
index f596dbe88782e07a871905515175e67a9accfb9c..6214a42fec71cbfcff76e3c70d91a3168a253013 100644 (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
index e7f52c7954a5a5f9efe912c85a8b65d85d9a0167..99bb39ee299477a1efef29bf0849b0e4ef20dae2 100644 (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;
 }
 
 
index c3d62de312b60008994785b162e7b917d799c597..a21d7f65ba3f427925d3d6baf8ae210e551aa728 100644 (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.
index c7486f4c381527c7defdf84162450ab329144524..507ce4962f28727c766bd9c0c8d7c82830b5ac97 100644 (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
index 4d1381a60596369f66e13999c17acbbe6d43d7b7..62a9ee02124c36695ebcba198a28fd259e5e7c23 100644 (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);
+               }
        }
 }