Paragraph on top level do not need cprotection.

This commit is contained in:
Juergen Spitzmueller 2018-04-22 20:15:04 +02:00
parent 26ea1e1496
commit a883133e8d

View File

@ -3449,8 +3449,13 @@ bool Paragraph::isHardHyphenOrApostrophe(pos_type pos) const
bool Paragraph::needsCProtection() const
{
// first check the layout of the paragraph
if (layout().needcprotect) {
// first check the layout of the paragraph, but only in insets
InsetText const * textinset = inInset().asInsetText();
bool const maintext = textinset
? textinset->text().isMainText()
: false;
if (!maintext && layout().needcprotect) {
// Environments need cprotection regardless the content
if (layout().latextype == LATEX_ENVIRONMENT)
return true;