commit ac5c2be8db2063a4fd9d6e74f4e03b91131421d6
Author: Juergen Spitzmueller <sp...@lyx.org>
Date:   Mon Sep 10 12:29:22 2018 +0200

    Amend 2d4ac90fd20eac once more
    
    Only use local switch in RTL environment.
    
    (cherry picked from commit e158d661b924102acb87a3c92f800a463fdca408)
---
 src/output_latex.cpp |   11 +++++++----
 status.23x           |    5 ++++-
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/src/output_latex.cpp b/src/output_latex.cpp
index 1cdb6dd..bdc7cb2 100644
--- a/src/output_latex.cpp
+++ b/src/output_latex.cpp
@@ -835,11 +835,14 @@ void TeXOnePar(Buffer const & buf,
        // Also, if an RTL language is set via environment in polyglossia,
        // only a nested \\text<lang> command will reset the direction for LTR
        // languages (see # 10111).
-       bool const pg_rtl_env =
-               use_polyglossia && outer_language->rightToLeft() && 
!par_language->rightToLeft();
+       bool const in_polyglossia_rtl_env =
+               use_polyglossia
+               && runparams.local_font != 0
+               && outer_language->rightToLeft()
+               && !par_language->rightToLeft();
        bool const localswitch = text.inset().forceLocalFontSwitch()
                        || (using_begin_end && text.inset().forcePlainLayout())
-                       || pg_rtl_env;
+                       || in_polyglossia_rtl_env;
        if (localswitch) {
                lang_begin_command = use_polyglossia ?
                            "\\text$$lang$$opts{" : 
lyxrc.language_command_local;
@@ -1181,7 +1184,7 @@ void TeXOnePar(Buffer const & buf,
                                    || (atSameLastLangSwitchDepth(state)
                                        && state->lang_switch_depth_.size()
                                        && cur_lang != par_lang)
-                                   || pg_rtl_env)
+                                   || in_polyglossia_rtl_env)
                                {
                                        if (using_begin_end && !localswitch)
                                                os << breakln;
diff --git a/status.23x b/status.23x
index d2e9291..8ff974a 100644
--- a/status.23x
+++ b/status.23x
@@ -96,6 +96,9 @@ What's new
 
 - Fix text direction issue in info insets with RTL context (bug 10463).
 
+- Fix text direction problem with polyglossia with nested languages
+  (part of bug 10111).
+
 - Fix output of key symbols with info inset on the Mac (bug 10641).
 
 - Fix output of table cells with multiple languages (bug 11128).
@@ -108,7 +111,7 @@ What's new
 
 - Ignore horizontal wheel scrolling in work area (bug 11257).
 
-- Avoid crash wne cursor is outside of workarea (bug 11296).
+- Avoid crash when cursor is outside of work area (bug 11296).
 
 
 

Reply via email to