]> git.lyx.org Git - features.git/blobdiff - src/output_latex.cpp
Remove non-required ternary conditional.
[features.git] / src / output_latex.cpp
index 517ef13d22d17da0ca5927c680a7c37d6349b7ba..fa64895ef376ef40c67e3215d521842500af1d5e 100644 (file)
@@ -743,7 +743,7 @@ void TeXOnePar(Buffer const & buf,
 
        OutputParams runparams = runparams_in;
        runparams.isLastPar = (pit == pit_type(paragraphs.size() - 1));
-       // We reinitialze par begin and end to be on the safe side
+       // We reinitialize par begin and end to be on the safe side
        // with embedded inset as we don't know if they set those
        // value correctly.
        runparams.par_begin = 0;
@@ -1034,12 +1034,7 @@ void TeXOnePar(Buffer const & buf,
                                if (runparams.encoding->package() == Encoding::CJK
                                    && par_lang != openLanguageName(state)
                                    && !par_lang.empty()) {
-                                       string bc = use_polyglossia ?
-                                                   getPolyglossiaBegin(lang_begin_command, par_lang,
-                                                                       par_language->polyglossiaOpts(),
-                                                                       localswitch)
-                                                   : subst(lang_begin_command, "$$lang", par_lang);
-                                       os << bc
+                                       os << subst(lang_begin_command, "$$lang", par_lang)
                                           << lang_command_termination;
                                        if (using_begin_end)
                                                pushLanguageName(par_lang, localswitch);
@@ -1330,6 +1325,12 @@ void TeXOnePar(Buffer const & buf,
                                break;
                        }
                        case inputenc: {
+                               // FIXME: If we are in an inset and the switch happened outside this inset,
+                               // do not switch back at the end of the inset (bug #8479)
+                               // The following attempt does not help with listings-caption in a CJK document:
+                               // if (runparams_in.local_font != 0
+                               //    && runparams_in.encoding == runparams_in.local_font->language()->encoding())
+                               //      break;
                                os << "\\egroup";
                                state->open_encoding_ = none;
                                break;