]> git.lyx.org Git - features.git/commitdiff
Use LTR environment for forceLTR content with polyglossia
authorJuergen Spitzmueller <spitz@lyx.org>
Fri, 28 Sep 2018 06:36:44 +0000 (08:36 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Fri, 28 Sep 2018 16:32:32 +0000 (18:32 +0200)
Fixes: #10548
(cherry picked from commit 10c06f67c936d8a259b03f00084fd4969f17582b)

src/Paragraph.cpp
status.23x

index ba31b218253169f01b2192579fed7b2b5d2595e3..53121a2e8a91a96bfb80af2eb9d85c05ee7cd8b9 100644 (file)
@@ -1090,13 +1090,17 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
        odocstream::pos_type const len = os.os().tellp();
 
        if (inset->forceLTR()
-           && !runparams.use_polyglossia
            && running_font.isRightToLeft()
            // ERT is an exception, it should be output with no
            // decorations at all
            && inset->lyxCode() != ERT_CODE) {
-               if (running_font.language()->lang() == "farsi")
-                       os << "\\beginL" << termcmd;
+               if (runparams.use_polyglossia) {
+                       if (style.isCommand())
+                               os << "\\LR{";
+                       os << "\\begin{LTR}";
+               } else if (running_font.language()->lang() == "farsi"
+                          || running_font.language()->lang() == "arabic_arabi")
+                       os << "\\textLR{" << termcmd;
                else
                        os << "\\L{";
                close = true;
@@ -1153,10 +1157,10 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
        }
 
        if (close) {
-               if (running_font.language()->lang() == "farsi")
-                               os << "\\endL" << termcmd;
-                       else
-                               os << '}';
+               if (runparams.use_polyglossia && !style.isCommand())
+                       os << "\\end{LTR}";
+               else
+                       os << '}';
        }
 
        if (os.texrow().rows() > previous_row_count) {
index 7b3d5af44171eca9a32ab76d177d0ffdad531c17..b116ea993a369e176404a8626e3b6dce0df81676 100644 (file)
@@ -101,6 +101,9 @@ What's new
 - Fix text direction problem with polyglossia with nested languages
   (part of bug 10111).
 
+- Use LTR environment for forceLTR content in RTL context with
+  polyglossia (bug 10548).
+
 - Fix output of key symbols with info inset on the Mac (bug 10641).
 
 - Fix output of table cells with multiple languages (bug 11128).