From d89d60c5a7260840a6a6786804f636d584a4c6e8 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Sat, 16 Jul 2011 13:30:17 +0000 Subject: [PATCH] Fix bug #7682. Problem was that we were finding the children using the BufferList, which knows nothing about clones. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39327 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Encoding.cpp | 19 +++++++++++-------- src/Encoding.h | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/Encoding.cpp b/src/Encoding.cpp index 7900aed06f..a9c845b28d 100644 --- a/src/Encoding.cpp +++ b/src/Encoding.cpp @@ -533,32 +533,35 @@ docstring Encodings::fromLaTeXCommand(docstring const & cmd, docstring & rem, } -void Encodings::initUnicodeMath(Buffer const & buffer, bool clear_sets) +void Encodings::initUnicodeMath(Buffer const & buffer, bool for_master) { #ifdef TEX2LYX // The code below is not needed in tex2lyx and requires additional stuff (void)buffer; - (void)clear_sets; + (void)for_master; #else - if (clear_sets) { + if (for_master) { mathcmd.clear(); textcmd.clear(); mathsym.clear(); } - // Check master + // Check this buffer Inset & inset = buffer.inset(); InsetIterator it = inset_iterator_begin(inset); InsetIterator const end = inset_iterator_end(inset); for (; it != end; ++it) it->initUnicodeMath(); + if (!for_master) + return; + // Check children - BufferList::iterator bit = theBufferList().begin(); - BufferList::iterator const bend = theBufferList().end(); + ListOfBuffers blist = buffer.getDescendents(); + ListOfBuffers::const_iterator bit = blist.begin(); + ListOfBuffers::const_iterator const bend = blist.end(); for (; bit != bend; ++bit) - if (buffer.isChild(*bit)) - initUnicodeMath(**bit, false); + initUnicodeMath(**bit, false); #endif } diff --git a/src/Encoding.h b/src/Encoding.h index 1f367366a8..bed6aa3810 100644 --- a/src/Encoding.h +++ b/src/Encoding.h @@ -220,7 +220,7 @@ public: /** * Initialize mathcmd, textcmd, and mathsym sets. */ - static void initUnicodeMath(Buffer const & buffer, bool clear_sets = true); + static void initUnicodeMath(Buffer const & buffer, bool for_master = true); /** * If \p c cannot be encoded in the given \p encoding, convert * it to something that LaTeX can understand in mathmode.