]> git.lyx.org Git - lyx.git/blobdiff - src/Encoding.cpp
Revert "Use swap in InsetText::updateBuffer for notes ad friends"
[lyx.git] / src / Encoding.cpp
index 96e35ecbb707e04e75fee87cb30211fbbdc8173e..026ad3c43e190d8bbe48889d069a4cb948b5b45b 100644 (file)
@@ -588,7 +588,8 @@ bool Encodings::isKnownScriptChar(char_type const c, string & preamble)
        if (it == unicodesymbols.end())
                return false;
 
-       if (it->second.textpreamble() != "textgreek" && it->second.textpreamble() != "textcyr")
+       if (it->second.textpreamble() != "textgreek"
+           && it->second.textpreamble() != "textcyrillic")
                return false;
 
        if (preamble.empty()) {
@@ -599,6 +600,18 @@ bool Encodings::isKnownScriptChar(char_type const c, string & preamble)
 }
 
 
+bool Encodings::needsScriptWrapper(string const & script, string const & fontenc)
+{
+       if (script == "textgreek")
+               return (fontenc != "LGR");
+       if (script == "textcyrillic") {
+               return (fontenc != "T2A" && fontenc != "T2B"
+                       && fontenc != "T2C" && fontenc != "X2");
+       }
+       return false;
+}
+
+
 bool Encodings::isMathAlpha(char_type c)
 {
        return mathalpha.count(c);
@@ -715,16 +728,16 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile)
                                flags |= CharInfoForce;
                                forced.insert(symbol);
                        } else if (prefixIs(flag, "force=")) {
-                               vector<string> encodings =
+                               vector<string> encs =
                                        getVectorFromString(flag.substr(6), ";");
-                               for (size_t i = 0; i < encodings.size(); ++i)
-                                       forcedselected[encodings[i]].insert(symbol);
+                               for (size_t i = 0; i < encs.size(); ++i)
+                                       forcedselected[encs[i]].insert(symbol);
                                flags |= CharInfoForceSelected;
                        } else if (prefixIs(flag, "force!=")) {
-                               vector<string> encodings =
+                               vector<string> encs =
                                        getVectorFromString(flag.substr(7), ";");
-                               for (size_t i = 0; i < encodings.size(); ++i)
-                                       forcednotselected[encodings[i]].insert(symbol);
+                               for (size_t i = 0; i < encs.size(); ++i)
+                                       forcednotselected[encs[i]].insert(symbol);
                                flags |= CharInfoForceSelected;
                        } else if (flag == "mathalpha") {
                                mathalpha.insert(symbol);