From: Juergen Spitzmueller Date: Sun, 29 Apr 2018 11:18:05 +0000 (+0200) Subject: PassThru paragraphs have latex_language; consider this when checking X-Git-Tag: lyx-2.4.0dev-acb2ca7b~3527 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=15df033bcec5aa65cdb26b7f31b9082f3f7e05da;p=lyx.git PassThru paragraphs have latex_language; consider this when checking previous language Fixes: #10793. --- diff --git a/src/output_latex.cpp b/src/output_latex.cpp index c36ed2587b..25ec597387 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -790,6 +790,9 @@ void TeXOnePar(Buffer const & buf, // environment with nesting depth greater than (or equal to, but with // a different layout) the current one. If there is no previous // paragraph, the previous language is the outer language. + // Note further that we take the outer language also if the prior par + // is PassThru, since in that case it has latex_language, and all secondary + // languages have been closed (#10793). bool const use_prev_env_language = state->prev_env_language_ != 0 && priorpar && priorpar->layout().isEnvironment() @@ -797,12 +800,11 @@ void TeXOnePar(Buffer const & buf, || (priorpar->getDepth() == par.getDepth() && priorpar->layout() != par.layout())); Language const * const prev_language = - (pit != 0) + (priorpar && !priorpar->isPassThru()) ? (use_prev_env_language ? state->prev_env_language_ : priorpar->getParLanguage(bparams)) : outer_language; - bool const use_polyglossia = runparams.use_polyglossia; string const par_lang = use_polyglossia ? getPolyglossiaEnvName(par_language): par_language->babel();