]> git.lyx.org Git - lyx.git/commitdiff
Amend 2d4ac90fd20eac
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 8 Sep 2018 10:50:42 +0000 (12:50 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Wed, 26 Sep 2018 14:58:38 +0000 (16:58 +0200)
Properly close local language switch.

(cherry picked from commit 11163359772db1ca80dccde5087f55686b9da76d)

src/output_latex.cpp

index dbddb6c01b673d5a1cc3bc82ca1b3cf28cf28d61..1cdb6ddc4aee5e9b6915d97a535b174106069752 100644 (file)
@@ -835,9 +835,11 @@ 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 localswitch = text.inset().forceLocalFontSwitch()
                        || (using_begin_end && text.inset().forcePlainLayout())
-                       || (use_polyglossia && outer_language->rightToLeft() && !par_language->rightToLeft());
+                       || pg_rtl_env;
        if (localswitch) {
                lang_begin_command = use_polyglossia ?
                            "\\text$$lang$$opts{" : lyxrc.language_command_local;
@@ -1178,7 +1180,8 @@ void TeXOnePar(Buffer const & buf,
                                                && style != nextpar->layout())))
                                    || (atSameLastLangSwitchDepth(state)
                                        && state->lang_switch_depth_.size()
-                                       && cur_lang != par_lang))
+                                       && cur_lang != par_lang)
+                                   || pg_rtl_env)
                                {
                                        if (using_begin_end && !localswitch)
                                                os << breakln;