]> git.lyx.org Git - features.git/commitdiff
Paragraph on top level do not need cprotection.
authorJuergen Spitzmueller <spitz@lyx.org>
Sun, 22 Apr 2018 18:15:04 +0000 (20:15 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sun, 22 Apr 2018 18:15:04 +0000 (20:15 +0200)
src/Paragraph.cpp

index 7f1bf4cca2bdd051c3397595d2bd2fb870458bed..4bd483e44d3ccf23962b1549ff85c92b2aed22fc 100644 (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;