From 76cbbc2fb42a76dff1ea217d7b5fa42135edf702 Mon Sep 17 00:00:00 2001 From: Stefan Schimanski Date: Wed, 23 Jan 2008 00:26:48 +0000 Subject: [PATCH] * Fix latex output of child documents when rendered alone. 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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 90b47b4e40..bf02199197 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -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); -- 2.39.5