From 14f8faa01a9dd02c93e2fb259bd4984ff9f8163f Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Tue, 12 Jan 2010 15:25:04 +0000 Subject: [PATCH] A couple changes related to cloning: (i) release the macro lock after we've cloned, so that... (ii) we can regenerate the macro caches before doing XHTML output. It may be worth doing the regeneration in the clone() routine itself, but it appears that the export routines now all do it anyway. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32983 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Buffer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 5288a4f422..2bff23e056 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -407,6 +407,7 @@ Buffer * Buffer::clone() const child_clone->d->setParent(buffer_clone); buffer_clone->setChild(dit, child_clone); } + buffer_clone->d->macro_lock = false; return buffer_clone; } @@ -1490,6 +1491,8 @@ void Buffer::writeLyXHTMLSource(odocstream & os, updateLabels(UpdateMaster, true); checkBibInfoCache(); d->bibinfo_.makeCitationLabels(*this); + updateMacros(); + updateMacroInstances(); if (!only_body) { os << "\n"; @@ -2555,7 +2558,7 @@ MacroData const * Buffer::getMacro(docstring const & name, void Buffer::updateMacros(DocIterator & it, DocIterator & scope) const { - pit_type lastpit = it.lastpit(); + pit_type const lastpit = it.lastpit(); // look for macros in each paragraph while (it.pit() <= lastpit) { -- 2.39.5