]> git.lyx.org Git - lyx.git/commitdiff
Fix issue with language switch in Arguments insets
authorEnrico Forestieri <forenr@lyx.org>
Wed, 11 Oct 2017 07:13:11 +0000 (09:13 +0200)
committerEnrico Forestieri <forenr@lyx.org>
Wed, 11 Oct 2017 22:02:54 +0000 (00:02 +0200)
In some insets such as Arguments, a local language switch has to be
used. However, if the language inside the inset was set to be equal
to the outer language, the code decided not to switch language. But
then got confused and tried to close a switch that was never opened.
This patch forces the switch even if the outer language is the same.

(cherry picked from commit ce4f39d414a26edcf54c1e24d6142e6b929586d7)

src/output_latex.cpp

index e0163ad2fad3ad85754341da38cdbb9416cfa984..02667aae9f69b6ae24367f3ade9b00a241eaa7b7 100644 (file)
@@ -882,7 +882,7 @@ void TeXOnePar(Buffer const & buf,
                        }
                        // With CJK, the CJK tag has to be closed first (see below)
                        if (runparams.encoding->package() != Encoding::CJK
-                           && par_lang != openLanguageName(state)
+                           && (par_lang != openLanguageName(state) || localswitch)
                            && !par_lang.empty()) {
                                string bc = use_polyglossia ?
                                          getPolyglossiaBegin(lang_begin_command, par_lang, par_language->polyglossiaOpts())