]> git.lyx.org Git - lyx.git/blobdiff - src/BufferParams.cpp
Make sure a pointer is valid before using it
[lyx.git] / src / BufferParams.cpp
index 9fa1f1ae4631a3d8bc8587a75336739afda63e3e..fa95e6a8f584d38a0685d3e4983ec75bd3c486b8 100644 (file)
@@ -1866,6 +1866,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
        // Now insert the LyX specific LaTeX commands...
        docstring lyxpreamble;
        features.resolveAlternatives();
+       features.expandMultiples();
 
        if (output_sync) {
                if (!output_sync_macro.empty())
@@ -2350,17 +2351,7 @@ bool BufferParams::addLayoutModule(string const & modName)
 
 string BufferParams::bufferFormat() const
 {
-       string format = documentClass().outputFormat();
-       if (format == "latex") {
-               if (useNonTeXFonts)
-                       // FIXME: In this context, this means "xetex or luatex"
-                       // with fontspec. We cannot differentiate further here.
-                       // But maybe use a more appropriate string.
-                       return "xetex";
-               if (encoding().package() == Encoding::japanese)
-                       return "platex";
-       }
-       return format;
+       return documentClass().outputFormat();
 }
 
 
@@ -2417,17 +2408,14 @@ vector<string> BufferParams::backends() const
 
        // FIXME: Don't hardcode format names here, but use a flag
        if (buffmt == "latex") {
-               if (!useNonTeXFonts) {
-                       v.push_back("pdflatex");
-                       v.push_back("latex");
-               }
-               v.push_back("luatex");
-               v.push_back("dviluatex");
-               v.push_back("xetex");
-       } else if (buffmt == "xetex") {
-               v.push_back("xetex");
-               // FIXME: need to test all languages (bug 8205)
-               if (!language || !language->isPolyglossiaExclusive()) {
+               if (encoding().package() == Encoding::japanese)
+                       v.push_back("platex");
+               else {
+                       if (!useNonTeXFonts) {
+                               v.push_back("pdflatex");
+                               v.push_back("latex");
+                       }
+                       v.push_back("xetex");
                        v.push_back("luatex");
                        v.push_back("dviluatex");
                }