]> git.lyx.org Git - features.git/commitdiff
tex2lyx: reset language after polyglossia lang environment has been closed
authorJuergen Spitzmueller <spitz@lyx.org>
Tue, 26 May 2020 08:15:52 +0000 (10:15 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Tue, 26 May 2020 15:49:17 +0000 (17:49 +0200)
Fixes #11878

(cherry picked from commit 5b2479176b0bb8bc3e9a2946e15922e0623e120e)

src/tex2lyx/text.cpp
status.23x

index 702293f6f9192be12084526e5dbccff046095207..8abc78c9bb3c52f43fbb222cbf566d8bb2a43da3 100644 (file)
@@ -1641,11 +1641,15 @@ void parse_environment(Parser & p, ostream & os, bool outer,
                        parent_context.check_end_layout(os);
                        parent_context.new_paragraph(os);
                }
+               // store previous language because we must reset it at the end
+               string const lang_old = parent_context.font.language;
                // save the language in the context so that it is
                // handled by parse_text
                parent_context.font.language =
                        preamble.polyglossia2lyx(fromPolyglossiaEnvironment(name));
                parse_text(p, os, FLAG_END, outer, parent_context);
+               // reset previous language
+               parent_context.font.language = lang_old;
                // Just in case the environment is empty
                parent_context.extra_stuff.erase();
                // We must begin a new paragraph to reset the language
index 50b68bfb2749225194d5ea1673cd6a782f9a6f59..c4d3cc62f5cf8e079ef60af9c7213335cebbcddc 100644 (file)
@@ -155,6 +155,8 @@ What's new
 
 * TEX2LYX
 
+- Fix import of nested polyglossia language environments (bug 11878).
+
 
 * LYXHTML