From ad9887da9c184f66bddc070da1667c710f80d737 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 11 Jul 2016 11:18:55 +0200 Subject: [PATCH] Simplify BufferParams::bufferFormat() 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 | 21 ++------------------- src/Converter.cpp | 4 +++- src/frontends/qt4/GuiErrorList.cpp | 8 +++----- src/insets/InsetListings.cpp | 2 +- 4 files changed, 9 insertions(+), 26 deletions(-) diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 9fa1f1ae46..44ddc35561 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -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 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); diff --git a/src/Converter.cpp b/src/Converter.cpp index 6acd05a22b..465e256bbd 100644 --- a/src/Converter.cpp +++ b/src/Converter.cpp @@ -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; diff --git a/src/frontends/qt4/GuiErrorList.cpp b/src/frontends/qt4/GuiErrorList.cpp index fdc334f282..14d4038fb0 100644 --- a/src/frontends/qt4/GuiErrorList.cpp +++ b/src/frontends/qt4/GuiErrorList.cpp @@ -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; } diff --git a/src/insets/InsetListings.cpp b/src/insets/InsetListings.cpp index e4b8c7f1ee..1afa0f3612 100644 --- a/src/insets/InsetListings.cpp +++ b/src/insets/InsetListings.cpp @@ -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()) {