]> git.lyx.org Git - lyx.git/commitdiff
bug 806 change layout to default when deleting empty keepempty paragraphs
authorLars Gullik Bjønnes <larsbj@gullik.org>
Fri, 15 Jul 2005 16:27:06 +0000 (16:27 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Fri, 15 Jul 2005 16:27:06 +0000 (16:27 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10219 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/text.C

index e1cadd9cba9f6db07f293f516ea8dc656297ce65..2537f9e595832cb4ed4f041bf51c22aaf3d367b2 100644 (file)
@@ -1,5 +1,8 @@
 2005-07-15    <lgb@tandberg.net>
 
+       * text.C (backspace): bug 806 for empty keepempty paragraphs we
+       change the layout to default before letting DEPM do its thing.
+
        * paragraph_funcs.C (breakParagraph): dont reset the layout on
        keepEmpty paragraphs
 
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;
                        }