commit d13e3193b32ecb2467ed092d477a1696d7d8de55
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Tue May 26 10:15:52 2020 +0200

    tex2lyx: reset language after polyglossia lang environment has been closed
    
    Fixes #11878
    
    (cherry picked from commit 5b2479176b0bb8bc3e9a2946e15922e0623e120e)
---
 src/tex2lyx/text.cpp |    4 ++++
 status.23x           |    2 ++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index 702293f..8abc78c 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -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
diff --git a/status.23x b/status.23x
index 50b68bf..c4d3cc6 100644
--- a/status.23x
+++ b/status.23x
@@ -155,6 +155,8 @@ What's new
 
 * TEX2LYX
 
+- Fix import of nested polyglossia language environments (bug 11878).
+
 
 * LYXHTML
 
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to