]> git.lyx.org Git - features.git/commitdiff
Fix bug #7682 for branch. Problem was that we were finding the children
authorRichard Heck <rgheck@comcast.net>
Sat, 16 Jul 2011 13:50:02 +0000 (13:50 +0000)
committerRichard Heck <rgheck@comcast.net>
Sat, 16 Jul 2011 13:50:02 +0000 (13:50 +0000)
using the BufferList, which knows nothing about clones.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39329 a592a061-630c-0410-9148-cb99ea01b6c8

src/Encoding.cpp
src/Encoding.h
status.20x

index 7900aed06f631fd85cf572c2857b5d29ef6cdbc8..a9c845b28dced34524d73144919f8741bbe5dd2c 100644 (file)
@@ -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
 }
 
index 1f367366a82dde25abb282b00ec83db45873b02f..bed6aa3810dfb80270e7eaf7488d7bc4840b1e05 100644 (file)
@@ -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.
index 3d2d0a6f5a095f992c0a68f91ff1f374bcd53ff3..3c86fa10f4a916da431f13be785afa518f2a5aa0 100644 (file)
@@ -154,6 +154,7 @@ What's new
 
 - Fix output of chapter references when using prettyref.
 
+- Fix output of unicode math from within child documents (bug 7682).
 
 * USER INTERFACE