]> git.lyx.org Git - lyx.git/blobdiff - src/BufferParams.cpp
Add FIXME
[lyx.git] / src / BufferParams.cpp
index 906061aa63e8fe4edcf560ac3239e3171989a06d..7832b268d21d8f29952c644fd48732eca09c7ef9 100644 (file)
@@ -1452,7 +1452,7 @@ void BufferParams::validate(LaTeXFeatures & features) const
 
        // some languages are only available via polyglossia
        if (features.hasPolyglossiaExclusiveLanguages())
-          features.require("polyglossia");
+               features.require("polyglossia");
 
        if (useNonTeXFonts && fontsMath() != "auto")
                features.require("unicode-math");
@@ -1647,7 +1647,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
                   << from_ascii(fonts_default_family) << "}\n";
 
        // set font encoding
-       // XeTeX and LuaTeX with Unicode fonts do not need fontenc
+       // XeTeX and LuaTeX (with OS fonts) do not need fontenc
        if (!useNonTeXFonts && !features.isProvided("fontenc")
            && font_encoding() != "default") {
                // get main font encodings
@@ -2182,14 +2182,17 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
                        os << "[" << from_ascii(language->polyglossiaOpts()) << "]";
                os << "{" << from_ascii(language->polyglossia()) << "}\n";
                // now setup the other languages
-               std::map<std::string, std::string> const polylangs =
+               set<string> const polylangs =
                        features.getPolyglossiaLanguages();
-               for (std::map<std::string, std::string>::const_iterator mit = polylangs.begin();
+               for (set<string>::const_iterator mit = polylangs.begin();
                     mit != polylangs.end() ; ++mit) {
+                       // We do not output the options here; they are output in
+                       // the language switch commands. This is safer if multiple
+                       // varieties are used.
+                       if (*mit == language->polyglossia())
+                               continue;
                        os << "\\setotherlanguage";
-                       if (!mit->second.empty())
-                               os << "[" << from_ascii(mit->second) << "]";
-                       os << "{" << from_ascii(mit->first) << "}\n";
+                       os << "{" << from_ascii(*mit) << "}\n";
                }
        }
 
@@ -2942,7 +2945,7 @@ vector<string> const BufferParams::font_encodings() const
 
        vector<string> fontencs;
 
-       // "default" means "no explicit font encoding, don't load fontenc.sty"
+       // "default" means "no explicit font encoding"
        if (doc_fontenc != "default") {
                fontencs = getVectorFromString(doc_fontenc);
                if (!language->fontenc().empty()