[LyX/master] Fix language direction switch issue

Jürgen Spitzmüller spitz at lyx.org
Mon Feb 21 08:55:29 UTC 2022


Am Montag, dem 21.02.2022 um 09:16 +0100 schrieb Juergen Spitzmueller:
> commit 0d7d8c37e3962dab0e76dd5b21bfee308e522df2
> Author: Juergen Spitzmueller <spitz at lyx.org>
> Date:   Mon Feb 21 09:49:32 2022 +0100
> 
>     Fix language direction switch issue
>     
>     reported at https://marc.info/?l=lyx-users&m=164538003727435&w=2

Riki, this should also go to stable.

Jürgen

> ---
>  src/output_latex.cpp |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/src/output_latex.cpp b/src/output_latex.cpp
> index f6c7375..03ac2b4 100644
> --- a/src/output_latex.cpp
> +++ b/src/output_latex.cpp
> @@ -933,10 +933,12 @@ void TeXOnePar(Buffer const & buf,
>                         break;
>                 }
>         }
> +       bool const have_prior_nptpar =
> +                       prior_nontitle_par && !prior_nontitle_par-
> >isPassThru();
>         Language const * const prev_language =
>                 runparams_in.for_searchAdv != OutputParams::NoSearch
>                         ? languages.getLanguage("ignore")
> -                       : (prior_nontitle_par && !prior_nontitle_par-
> >isPassThru())
> +                       : (have_prior_nptpar)
>                                 ? (use_prev_env_language 
>                                         ? state->prev_env_language_
>                                         : prior_nontitle_par-
> >getParLanguage(bparams))
> @@ -982,7 +984,9 @@ void TeXOnePar(Buffer const & buf,
>                 use_polyglossia
>                 && runparams.local_font != nullptr
>                 && outer_language->rightToLeft()
> -               && !par_language->rightToLeft();
> +               && !par_language->rightToLeft()
> +               && !(have_prior_nptpar
> +                    && (prev_language->rightToLeft() !=
> par_language->rightToLeft()));
>         bool const localswitch =
>                         (runparams_in.for_searchAdv !=
> OutputParams::NoSearch
>                         || text.inset().forceLocalFontSwitch()

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20220221/e2371429/attachment.asc>


More information about the lyx-devel mailing list