[LyX/master] Maintain plain layout for separating paragraphs when switching layouts (#11936)

Juergen Spitzmueller spitz at lyx.org
Sat Aug 15 05:49:16 UTC 2020


commit 89d9334e03c311a4a7585f40ad81880304d174d4
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)
---
 src/Text2.cpp |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/Text2.cpp b/src/Text2.cpp
index 2d1ca0e..18fc518 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