From c95df1c1473d80e1511e4363290aedb220dc758d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Fri, 15 Jul 2005 16:27:06 +0000 Subject: [PATCH] bug 806 change layout to default when deleting empty keepempty paragraphs git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10219 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 3 +++ src/text.C | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index e1cadd9cba..2537f9e595 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2005-07-15 + * 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 diff --git a/src/text.C b/src/text.C index d322ec48ba..2f1a099dab 100644 --- a/src/text.C +++ b/src/text.C @@ -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; } -- 2.39.2