]> git.lyx.org Git - lyx.git/blobdiff - src/BufferEncodings.cpp
Correct Right Arrow key processing in Modules list
[lyx.git] / src / BufferEncodings.cpp
index 87000ac9c82402e7f24443f580926dc6c2340bf1..d4f08fca34dad10387d32a118aacf38502f5319f 100644 (file)
@@ -45,11 +45,8 @@ void BufferEncodings::initUnicodeMath(Buffer const & buffer, bool for_master)
                return;
 
        // Check children
-       ListOfBuffers blist = buffer.getDescendents();
-       ListOfBuffers::const_iterator bit = blist.begin();
-       ListOfBuffers::const_iterator const bend = blist.end();
-       for (; bit != bend; ++bit)
-               initUnicodeMath(**bit, false);
+       for (Buffer * buf : buffer.getDescendants())
+               initUnicodeMath(*buf, false);
 }
 
 
@@ -81,7 +78,7 @@ void BufferEncodings::validate(char_type c, LaTeXFeatures & features, bool for_m
                                                features.require(feat);
                                        }
                                } else
-                                       features.addPreambleSnippet(mathpreamble);
+                                       features.addPreambleSnippet(from_utf8(mathpreamble));
                        }
                }
                // with utf8-plain, we do not load packages (see #7766)
@@ -93,10 +90,13 @@ void BufferEncodings::validate(char_type c, LaTeXFeatures & features, bool for_m
                                        while (!feats.empty()) {
                                                string feat;
                                                feats = split(feats, feat, ',');
-                                               features.require(feat);
+                                               // context-dependent features are handled
+                                               // in Paragraph::Private::validate()
+                                               if (!contains(feat, '='))
+                                                       features.require(feat);
                                        }
                                } else
-                                       features.addPreambleSnippet(textpreamble);
+                                       features.addPreambleSnippet(from_utf8(textpreamble));
                        }
                }
        }