]> git.lyx.org Git - features.git/commitdiff
Refine lang nesting fix
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 19 Jun 2015 17:02:35 +0000 (19:02 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Fri, 19 Jun 2015 17:03:11 +0000 (19:03 +0200)
src/output_latex.cpp

index fdfe7f83e7ff266d72a1eb00a003ba595e5afe23..80cb9904425419affc7cb4a41dac52a4bd15e156 100644 (file)
@@ -194,6 +194,8 @@ static TeXEnvironmentData prepareEnvironment(Buffer const & buf,
        }
 
        if (style.isEnvironment()) {
+               if (par_lang != doc_lang)
+                       state->open_polyglossia_lang_ = par_lang;
                os << "\\begin{" << from_ascii(style.latexname()) << '}';
                if (!style.latexargs().empty()) {
                        OutputParams rp = runparams;
@@ -969,10 +971,8 @@ void TeXOnePar(Buffer const & buf,
                                        unskip_newline = !localswitch;
                                }
                        } else if (!par_lang.empty()) {
-                               // If we are in an environment, we have to close the language afterwards
-                               if (style.isEnvironment())
-                                       state->open_polyglossia_lang_ = par_lang;
-                               else {
+                               // If we are in an environment, we have to close the "outer" language afterwards
+                               if (!style.isEnvironment() || state->open_polyglossia_lang_ != par_lang) {
                                        os << from_ascii(subst(
                                                lang_end_command,
                                                "$$lang",