Use LTR environment for forceLTR content with polyglossia

Fixes: #10548
(cherry picked from commit 10c06f67c9)
This commit is contained in:
Juergen Spitzmueller 2018-09-28 08:36:44 +02:00
parent 1e26864c0a
commit a754912e88
2 changed files with 14 additions and 7 deletions

View File

@ -1090,13 +1090,17 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
odocstream::pos_type const len = os.os().tellp(); odocstream::pos_type const len = os.os().tellp();
if (inset->forceLTR() if (inset->forceLTR()
&& !runparams.use_polyglossia
&& running_font.isRightToLeft() && running_font.isRightToLeft()
// ERT is an exception, it should be output with no // ERT is an exception, it should be output with no
// decorations at all // decorations at all
&& inset->lyxCode() != ERT_CODE) { && inset->lyxCode() != ERT_CODE) {
if (running_font.language()->lang() == "farsi") if (runparams.use_polyglossia) {
os << "\\beginL" << termcmd; 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 else
os << "\\L{"; os << "\\L{";
close = true; close = true;
@ -1153,8 +1157,8 @@ void Paragraph::Private::latexInset(BufferParams const & bparams,
} }
if (close) { if (close) {
if (running_font.language()->lang() == "farsi") if (runparams.use_polyglossia && !style.isCommand())
os << "\\endL" << termcmd; os << "\\end{LTR}";
else else
os << '}'; os << '}';
} }

View File

@ -101,6 +101,9 @@ What's new
- Fix text direction problem with polyglossia with nested languages - Fix text direction problem with polyglossia with nested languages
(part of bug 10111). (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 key symbols with info inset on the Mac (bug 10641).
- Fix output of table cells with multiple languages (bug 11128). - Fix output of table cells with multiple languages (bug 11128).