commit a883133e8d04bf6ddd86177f1db344acfb1f2cf4
Author: Juergen Spitzmueller <[email protected]>
Date:   Sun Apr 22 20:15:04 2018 +0200

    Paragraph on top level do not need cprotection.
---
 src/Paragraph.cpp |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index 7f1bf4c..4bd483e 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;

Reply via email to