]> git.lyx.org Git - lyx.git/blobdiff - src/Encoding.cpp
tex2lyx: roundtrip support for the suppress_date option, for the remaining part I...
[lyx.git] / src / Encoding.cpp
index 7900aed06f631fd85cf572c2857b5d29ef6cdbc8..a8846527b44727d14d04131358a3e888ef5b5282 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
 }
 
@@ -803,6 +806,10 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile)
                        breakout = true;
                }
 
+               // backward compatibility
+               if (info.mathpreamble == "esintoramsmath")
+                       info.mathpreamble = "esint|amsmath";
+
                if (!info.textpreamble.empty())
                        info.textfeature = info.textpreamble[0] != '\\';
                if (!info.mathpreamble.empty())