]> git.lyx.org Git - features.git/commitdiff
* Fix latex output of child documents when rendered alone.
authorStefan Schimanski <sts@lyx.org>
Wed, 23 Jan 2008 00:26:48 +0000 (00:26 +0000)
committerStefan Schimanski <sts@lyx.org>
Wed, 23 Jan 2008 00:26:48 +0000 (00:26 +0000)
Problem: Before macro redefinitions in a child buffer did not see the
parent original definition because an Buffer::updateMacros() call had
updated the redefinition_ flag to "false" after the parent buffer had
temporarely been set to =0 for latex output of the child.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22656 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp

index 90b47b4e40089c6897e0f7cd85bd8daac60cde9e..bf02199197124afa7f0040b5d14fe8ab5be57205 100644 (file)
@@ -1128,9 +1128,15 @@ void Buffer::writeLaTeXSource(odocstream & os,
        
        LYXERR(Debug::INFO, "preamble finished, now the body.");
 
+       // load children, if not already done. 
+       // This includes an updateMacro() call.
+       // Don't move this behind the parent_buffer=0 code below,
+       // because then the macros will not get the right "redefinition"
+       // flag as they don't see the parent macros which are output before.
+       loadChildDocuments();
+
        // fold macros if possible, still with parent buffer as the
        // macros will be put in the prefix anyway.
-       updateMacros();
        updateMacroInstances();
 
        // if we are doing a real file with body, even if this is the
@@ -1145,8 +1151,6 @@ void Buffer::writeLaTeXSource(odocstream & os,
                d->parent_buffer = 0;
        }
 
-       loadChildDocuments();
-
        // the real stuff
        latexParagraphs(*this, paragraphs(), os, d->texrow, runparams);