When using polyglossia (bidi), paragraph directions don't need to be swapped

Bidi does that.

Fixes: #11399
(cherry picked from commit 9d20bc4e98)
This commit is contained in:
Juergen Spitzmueller 2019-01-07 13:54:23 +01:00
parent 45931f7a60
commit 5f3c0d5aca
2 changed files with 12 additions and 4 deletions

View File

@ -2278,6 +2278,9 @@ int Paragraph::Private::startTeXParParams(BufferParams const & bparams,
string const begin_tag = "\\begin";
InsetCode code = ownerCode();
bool const lastpar = runparams.isLastPar;
// RTL without the Bidi package switches the left/right logic
bool const rtl_classic = owner_->getParLanguage(bparams)->rightToLeft()
&& !runparams.use_polyglossia;
switch (curAlign) {
case LYX_ALIGN_NONE:
@ -2287,13 +2290,13 @@ int Paragraph::Private::startTeXParParams(BufferParams const & bparams,
case LYX_ALIGN_DECIMAL:
break;
case LYX_ALIGN_LEFT: {
if (!owner_->getParLanguage(bparams)->rightToLeft())
if (!rtl_classic)
corrected_env(os, begin_tag, "flushleft", code, lastpar, column);
else
corrected_env(os, begin_tag, "flushright", code, lastpar, column);
break;
} case LYX_ALIGN_RIGHT: {
if (!owner_->getParLanguage(bparams)->rightToLeft())
if (!rtl_classic)
corrected_env(os, begin_tag, "flushright", code, lastpar, column);
else
corrected_env(os, begin_tag, "flushleft", code, lastpar, column);
@ -2336,6 +2339,9 @@ bool Paragraph::Private::endTeXParParams(BufferParams const & bparams,
string const end_tag = "\\par\\end";
InsetCode code = ownerCode();
bool const lastpar = runparams.isLastPar;
// RTL without the Bidi package switches the left/right logic
bool const rtl_classic = owner_->getParLanguage(bparams)->rightToLeft()
&& !runparams.use_polyglossia;
switch (curAlign) {
case LYX_ALIGN_NONE:
@ -2345,13 +2351,13 @@ bool Paragraph::Private::endTeXParParams(BufferParams const & bparams,
case LYX_ALIGN_DECIMAL:
break;
case LYX_ALIGN_LEFT: {
if (!owner_->getParLanguage(bparams)->rightToLeft())
if (!rtl_classic)
output = corrected_env(os, end_tag, "flushleft", code, lastpar, col);
else
output = corrected_env(os, end_tag, "flushright", code, lastpar, col);
break;
} case LYX_ALIGN_RIGHT: {
if (!owner_->getParLanguage(bparams)->rightToLeft())
if (!rtl_classic)
output = corrected_env(os, end_tag, "flushright", code, lastpar, col);
else
output = corrected_env(os, end_tag, "flushleft", code, lastpar, col);

View File

@ -83,6 +83,8 @@ What's new
- Fix SVG to PNG image conversion problem with inkscape on Mac.
On-screen display of SVG graphics was broken for e.g. users guide.
- Fix paragraph alignment in RTL when using polyglossia (bidi) (bug 11399).
* USER INTERFACE