]> git.lyx.org Git - features.git/commitdiff
Fix nesting problem with numbers in RTL text
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 21 Jul 2018 13:50:35 +0000 (15:50 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 21 Jul 2018 13:50:35 +0000 (15:50 +0200)
\textcolor must precede any \beginL

Fixes: #6283
src/Font.cpp

index b8a6a295310078972e99ed1dd9354eeb3574aa91..549f4b817138f347eeb7b6fd0a139a6a8fa3029e 100644 (file)
@@ -349,21 +349,6 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
                }
        }
 
-       // If the current language is Hebrew, Arabic, or Farsi
-       // the numbers are written Left-to-Right. ArabTeX package
-       // and bidi (polyglossia) reorder the number automatically
-       // but the packages used for Hebrew and Farsi (Arabi) do not.
-       if (!runparams.use_polyglossia
-           && !runparams.pass_thru
-           && bits_.number() == FONT_ON
-           && prev.fontInfo().number() != FONT_ON
-           && (language()->lang() == "hebrew"
-               || language()->lang() == "farsi"
-               || language()->lang() == "arabic_arabi")) {
-               os << "{\\beginL ";
-               count += 9;
-       }
-
        FontInfo f = bits_;
        f.reduce(base.bits_);
        FontInfo p = bits_;
@@ -413,6 +398,20 @@ int Font::latexWriteStartChanges(odocstream & os, BufferParams const & bparams,
                env = true; //We have opened a new environment
        }
        */
+       // If the current language is Hebrew, Arabic, or Farsi
+       // the numbers are written Left-to-Right. ArabTeX package
+       // and bidi (polyglossia) reorder the number automatically
+       // but the packages used for Hebrew and Farsi (Arabi) do not.
+       if (!runparams.use_polyglossia
+           && !runparams.pass_thru
+           && bits_.number() == FONT_ON
+           && prev.fontInfo().number() != FONT_ON
+           && (language()->lang() == "hebrew"
+               || language()->lang() == "farsi"
+               || language()->lang() == "arabic_arabi")) {
+               os << "{\\beginL ";
+               count += 9;
+       }
        if (f.emph() == FONT_ON) {
                os << "\\emph{";
                count += 6;