[LyX/master] Fix crash with polyglossia and intitle commands when lang_auto_end is false
Jürgen Spitzmüller
spitz at lyx.org
Thu Nov 21 07:46:00 UTC 2019
Am Donnerstag, den 21.11.2019, 08:24 +0100 schrieb Juergen
Spitzmueller:
> commit ed44bc9b12c0385eccf9323159365ae96b1b4f19
> Author: Juergen Spitzmueller <spitz at lyx.org>
> Date: Thu Nov 21 08:38:21 2019 +0100
>
> Fix crash with polyglossia and intitle commands when
> lang_auto_end is false
Riki, this should go to 2.3.4, if possible.
Jürgen
> ---
> src/output_latex.cpp | 12 +++++++++++-
> 1 files changed, 11 insertions(+), 1 deletions(-)
>
> diff --git a/src/output_latex.cpp b/src/output_latex.cpp
> index a349cbd..db56ff6 100644
> --- a/src/output_latex.cpp
> +++ b/src/output_latex.cpp
> @@ -781,6 +781,10 @@ void TeXOnePar(Buffer const & buf,
> ? nullptr : ¶graphs.at(pit + 1);
>
> bool const intitle_command = style.intitle &&
> style.isCommand();
> + // Intitle commands switch languages locally, thus increase
> + // language nesting level
> + if (intitle_command)
> + state->nest_level_ += 1;
>
> if (style.pass_thru) {
> Font const outerfont = text.outerFont(pit);
> @@ -1454,6 +1458,10 @@ void TeXOnePar(Buffer const & buf,
> }
> }
>
> + // Reset language nesting level after intitle command
> + if (intitle_command)
> + state->nest_level_ -= 1;
> +
> LYXERR(Debug::LATEX, "TeXOnePar for paragraph " << pit << "
> done; ptr "
> << &par << " next " << nextpar);
>
> @@ -1645,7 +1653,9 @@ void latexParagraphs(Buffer const & buf,
> "$$lang",
> mainlang))
> << '\n';
> - if (using_begin_end)
> + // If we have language_auto_begin, the stack will
> + // already be empty, nothing to pop()
> + if (using_begin_end && !lyxrc.language_auto_begin)
> popLanguageName();
> }
>
-------------- 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/20191121/6ebd87d9/attachment.asc>
More information about the lyx-devel
mailing list