]> git.lyx.org Git - features.git/commitdiff
Fix bug #8727: Text::breakParagraph() was always setting the default
authorRichard Heck <rgheck@lyx.org>
Fri, 7 Jun 2013 16:15:18 +0000 (12:15 -0400)
committerRichard Heck <rgheck@lyx.org>
Sun, 1 Dec 2013 18:23:43 +0000 (13:23 -0500)
layout, even if the paragraph in question requires plain layout.

src/Text.cpp

index 5bb70418eb8023ba7c8a9a70f42eee1cd7bae139..8e8d64132d192039d03510edc407a9d0f28b9ae5 100644 (file)
@@ -735,8 +735,11 @@ void Text::breakParagraph(Cursor & cur, bool inverse_logic)
        if (cur.lastpos() == 0 && !cpar.allowEmpty()) {
                if (changeDepthAllowed(cur, DEC_DEPTH))
                        changeDepth(cur, DEC_DEPTH);
-               else 
-                       setLayout(cur, tclass.defaultLayoutName());
+               else {
+                       docstring const & lay = cur.paragraph().usePlainLayout()
+                           ? tclass.plainLayoutName() : tclass.defaultLayoutName();
+                       setLayout(cur, lay);
+               }
                return;
        }