commit 5b2479176b0bb8bc3e9a2946e15922e0623e120e
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
---
 src/tex2lyx/text.cpp |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp
index f9201cd..ca69221 100644
--- a/src/tex2lyx/text.cpp
+++ b/src/tex2lyx/text.cpp
@@ -1639,18 +1639,22 @@ void parse_environment(Parser & p, ostream & os, bool 
outer,
                        break;
                }
 
-               // We need to use fromPolyglossiaEnvironment die to Arabic > 
arabic
+               // We need to use fromPolyglossiaEnvironment due to Arabic > 
arabic
                if (is_known(fromPolyglossiaEnvironment(name), 
preamble.polyglossia_languages)) {
                        // We must begin a new paragraph if not already done
-                       if (! parent_context.atParagraphStart()) {
+                       if (!parent_context.atParagraphStart()) {
                                parent_context.check_end_layout(os);
                                parent_context.new_paragraph(os);
                        }
-                       // save the language in the context so that it is
+                       // store previous language because we must reset it at 
the end
+                       string const lang_old = parent_context.font.language;
+                       // save new language in 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
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to