]> 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>
Sun, 22 Jul 2018 08:16:32 +0000 (10:16 +0200)
\textcolor must precede any \beginL

Fixes: #6283
(cherry picked from commit 114ebf00c4f12c8acf39b52e057f9a63a98dd58b)

src/Font.cpp
status.23x

index b810e454d4c65335bed03d0bef5c613698d9f9ec..79f0e2ed2d187746c749b67f27a61fe41ac46521 100644 (file)
@@ -347,21 +347,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_;
@@ -411,6 +396,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;
index 54a9cfd0c0b40b7530bd3675e1bbae0400483625..c18c116f19c6955957accff7e26834999c98ee33 100644 (file)
@@ -274,6 +274,8 @@ What's new
 - Fix insertion of quotation marks and brackets in RTL languages
   (bugs 11188 and 11187).
 
+- Fix nesting problem with numbers in RTL text (bug 6283).
+
 
 * INTERNALS