Fix language nesting regression

b1c68dccf8 and 46aed6d2b9 fixed some language nesting issues, but introduced
a regression for the case that there is a standard paragraph in a foreign
language, followed by a list (e.g. itemize) in the same language, followed
by the end of the document, as e.g. in lib/doc/de/Additional.lyx. The reason
for this was that not all language ending commands did reset
state->open_polyglossia_lang_ correctly.
I am sure that one can still construct broken corner cases, and I am also sure
that this was already possible before b1c68dccf8 and 46aed6d2b9. However,
this fix seems to fix the most important issues, and to get nesting completely
correct we would probably need some stack-like structure, for languages and
encodings, also for the CJK part (which is not touched at all by this commit).
This commit is contained in:
Georg Baum 2015-10-19 21:08:01 +02:00
parent e245a18da0
commit be3e470068

View File

@ -703,6 +703,8 @@ void TeXOnePar(Buffer const & buf,
"$$lang",
prev_lang))
<< lang_command_termination;
if (prev_lang == state->open_polyglossia_lang_)
state->open_polyglossia_lang_ = "";
}
// We need to open a new language if we couldn't close the previous
@ -1249,6 +1251,8 @@ void latexParagraphs(Buffer const & buf,
"$$lang",
mainlang))
<< '\n';
if (state->open_polyglossia_lang_ == mainlang)
state->open_polyglossia_lang_ = "";
}
// If the last paragraph is an environment, we'll have to close