]> git.lyx.org Git - lyx.git/blobdiff - src/BufferParams.cpp
ar.po: updates from Hatim
[lyx.git] / src / BufferParams.cpp
index 6af82c16e501b5d9a35a03fe0f577e0adadd3b0b..3f0f44aeff5956fe659c638593017700bf5008a2 100644 (file)
@@ -2173,14 +2173,17 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
                        lyxpreamble += "[" + from_ascii(language->polyglossiaOpts()) + "]";
                lyxpreamble += "{" + 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;
                        lyxpreamble += "\\setotherlanguage";
-                       if (!mit->second.empty())
-                               lyxpreamble += "[" + from_ascii(mit->second) + "]";
-                       lyxpreamble += "{" + from_ascii(mit->first) + "}\n";
+                       lyxpreamble += "{" + from_ascii(*mit) + "}\n";
                }
        }