[LyX/2.3.x] Maintain plain layout for separating paragraphs when switching layouts (#11936)
Juergen Spitzmueller
spitz at lyx.org
Sat Aug 15 06:53:40 UTC 2020
commit 028593b979a70aa40ef689b17321c5f2cbd9c416
Author: Juergen Spitzmueller <spitz at lyx.org>
Date: Sat Aug 15 08:14:17 2020 +0200
Maintain plain layout for separating paragraphs when switching layouts (#11936)
(cherry picked from commit 89d9334e03c311a4a7585f40ad81880304d174d4)
---
src/Text2.cpp | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/Text2.cpp b/src/Text2.cpp
index 71569db..a16a270 100644
--- a/src/Text2.cpp
+++ b/src/Text2.cpp
@@ -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));
}
More information about the lyx-cvs
mailing list