mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-26 06:15:16 +00:00
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:
parent
45931f7a60
commit
5f3c0d5aca
@ -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);
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user