]> git.lyx.org Git - features.git/commitdiff
Simplify BufferParams::bufferFormat()
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 11 Jul 2016 09:18:55 +0000 (11:18 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 11 Jul 2016 09:18:55 +0000 (11:18 +0200)
The differentiation of "xetex" and "platex" is not needed here,
is ambiguous and confusing (see #10013). The code that relies on
it can/should get its information otherwise.

Furthermore, polyglossia-exclusive languages now also work with
LuaTeX, since we support LuaTeX + polyglossia.

src/BufferParams.cpp
src/Converter.cpp
src/frontends/qt4/GuiErrorList.cpp
src/insets/InsetListings.cpp

index 9fa1f1ae4631a3d8bc8587a75336739afda63e3e..44ddc355614faa474d451db47f236a201145de74 100644 (file)
@@ -2350,17 +2350,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();
 }
 
 
@@ -2421,16 +2411,9 @@ vector<string> BufferParams::backends() const
                        v.push_back("pdflatex");
                        v.push_back("latex");
                }
+               v.push_back("xetex");
                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()) {
-                       v.push_back("luatex");
-                       v.push_back("dviluatex");
-               }
        } else
                v.push_back(buffmt);
 
index 6acd05a22b1b8c902138575bb9d1af700c2db187..465e256bbda339bb2c5bd6def33b69505612687d 100644 (file)
@@ -339,7 +339,9 @@ bool Converters::convert(Buffer const * buffer,
        runparams.flavor = getFlavor(edgepath, buffer);
 
        if (buffer) {
-               runparams.use_japanese = buffer->params().bufferFormat() == "platex";
+               runparams.use_japanese =
+                       buffer->params().bufferFormat() == "latex"
+                       && buffer->params().encoding().package() == Encoding::japanese;
                runparams.use_indices = buffer->params().use_indices;
                runparams.bibtex_command = (buffer->params().bibtex_command == "default") ?
                        string() : buffer->params().bibtex_command;
index fdc334f282fadac4e293f67088b30a63078494e2..14d4038fb05c7862acc55efc5661b533c6cd8f66 100644 (file)
@@ -44,11 +44,9 @@ string const guiErrorType(string const & s)
                return N_("DocBook");
        else if (s == "literate")
                return N_("Literate");
-       else if (s == "platex")
-               return N_("pLaTeX");
-       else if (s == "latex" || "xetex")
-               // All LaTeX variants except pLaTeX
-               // (LaTeX, PDFLaTeX, XeTeX, LuaTeX)
+       else if (s == "latex")
+               // This covers all LaTeX variants
+               // (LaTeX, PDFLaTeX, XeTeX, LuaTeX, pLaTeX)
                return N_("LaTeX");
        return s;
 }
index e4b8c7f1eef81d86f710b3203403afe96ea536b2..1afa0f3612625d663e8500d65dbbcb5c3de9ce11 100644 (file)
@@ -127,7 +127,7 @@ void InsetListings::latex(otexstream & os, OutputParams const & runparams) const
        // glyphs, except if full-unicode aware backends
        // such as XeTeX or LuaTeX are used, and with pLaTeX.
        bool const multibyte_possible = runparams.isFullUnicode()
-           || (buffer().params().bufferFormat() == "platex"
+           || (buffer().params().encoding().package() == Encoding::japanese
                && runparams.encoding->package() == Encoding::japanese);
 
        if (!multibyte_possible && !runparams.encoding->hasFixedWidth()) {