From a883133e8d04bf6ddd86177f1db344acfb1f2cf4 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sun, 22 Apr 2018 20:15:04 +0200 Subject: [PATCH] Paragraph on top level do not need cprotection. --- src/Paragraph.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 7f1bf4cca2..4bd483e44d 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -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;