]> git.lyx.org Git - lyx.git/blobdiff - src/bufferparams.C
Make lyx2lyx output the new external inset format.
[lyx.git] / src / bufferparams.C
index dded2ce1c888c70ca04433b8c2f5f301446995d2..d4c166aaf828de5bfeebfc15af4780e810ff738d 100644 (file)
@@ -38,10 +38,6 @@ using std::ostream;
 using std::endl;
 using std::pair;
 
-#ifdef WITH_WARNINGS
-#warning Do we need this horrible thing? (JMarc)
-#endif
-bool use_babel;
 
 BufferParams::BufferParams()
        // Initialize textclass to point to article. if `first' is
@@ -195,7 +191,7 @@ string const BufferParams::readToken(LyXLex & lex, string const & token)
                tracking_changes = lex.getInteger();
        } else if (token == "\\author") {
                lex.nextToken();
-               istringstream ss(lex.getString());
+               istringstream ss(STRCONV(lex.getString()));
                Author a;
                ss >> a;
                author_map.push_back(authorlist.record(a));
@@ -458,7 +454,7 @@ void BufferParams::writeFile(ostream & os) const
 }
 
 
-void BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features,
+bool BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features,
                              TexRow & texrow) const
 {
        os << "\\documentclass";
@@ -523,17 +519,14 @@ void BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features,
                clsoptions << "landscape,";
 
        // language should be a parameter to \documentclass
-       use_babel = false;
-       ostringstream language_options;
        if (language->babel() == "hebrew"
            && default_language->babel() != "hebrew")
                // This seems necessary
                features.useLanguage(default_language);
 
-       if (lyxrc.language_use_babel ||
-           language->lang() != lyxrc.default_language ||
-           features.hasLanguages()) {
-               use_babel = true;
+       ostringstream language_options;
+       bool const use_babel = features.useBabel();
+       if (use_babel) {
                language_options << features.getLanguages();
                language_options << language->babel();
                if (lyxrc.language_global_options)
@@ -845,6 +838,7 @@ void BufferParams::writeLaTeX(ostream & os, LaTeXFeatures & features,
        }
 
        os << lyxpreamble;
+       return use_babel;
 }
 
 void BufferParams::setPaperStuff()