]> git.lyx.org Git - lyx.git/blobdiff - src/text.C
bug 806 change layout to default when deleting empty keepempty paragraphs
[lyx.git] / src / text.C
index d322ec48ba714b5a9642a44deb91e96406874287..2f1a099dab1c6f9b21a36f3aa4221fc6f9fc6905 100644 (file)
@@ -1583,6 +1583,17 @@ void LyXText::backspace(LCursor & cur)
                        // handle the actual deletion of the paragraph.
 
                        if (cur.pit() != 0) {
+                                // For KeepEmpty layouts we need to get
+                                // rid of the keepEmpty setting first.
+                                // And the only way to do this is to
+                                // reset the layout to something
+                                // else: f.ex. the default layout.
+                                if (par.allowEmpty()) {
+                                        Buffer & buf = cur.buffer();
+                                        BufferParams const & bparams = buf.params();
+                                        par.layout(bparams.getLyXTextClass().defaultLayout());
+                                }
+                                
                                cursorLeft(cur);
                                return;
                        }