]> git.lyx.org Git - features.git/commitdiff
Maintain plain layout for separating paragraphs when switching layouts (#11936)
authorJuergen Spitzmueller <spitz@lyx.org>
Sat, 15 Aug 2020 06:14:17 +0000 (08:14 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Sat, 15 Aug 2020 07:17:19 +0000 (09:17 +0200)
(cherry picked from commit 89d9334e03c311a4a7585f40ad81880304d174d4)

src/Text2.cpp

index 71569dba46c968cc167a084650b4acf272098b71..a16a270432583205c2765fe68ff653662b33faaf 100644 (file)
@@ -182,7 +182,10 @@ void Text::setLayout(pit_type start, pit_type end,
 
        for (pit_type pit = start; pit != end; ++pit) {
                Paragraph & par = pars_[pit];
-               par.applyLayout(lyxlayout);
+               // Is this a separating paragraph?
+               bool const is_separator = par.size() == 1
+                               && par.isEnvSeparator(0);
+               par.applyLayout(is_separator ? bp.documentClass().plainLayout() : lyxlayout);
                if (lyxlayout.margintype == MARGIN_MANUAL)
                        par.setLabelWidthString(par.expandLabel(lyxlayout, bp));
        }