- Paragraph & par = cur.paragraph();
- // is it an empty paragraph?
- pos_type lastpos = cur.lastpos();
- if (lastpos == 0 || (lastpos == 1 && par.isSeparator(0))) {
- // This is an empty paragraph and we delete it just
- // by moving the cursor one step
- // left and let the DeleteEmptyParagraphMechanism
- // 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());
- }
+ BufferParams const & bufparams = cur.buffer().params();
+ LyXTextClass const & tclass = bufparams.getLyXTextClass();
+ ParagraphList & plist = cur.text()->paragraphs();
+ Paragraph const & par = cur.paragraph();
+ LCursor prevcur = cur;
+ --prevcur.pit();
+ prevcur.pos() = prevcur.lastpos();
+ Paragraph const & prevpar = prevcur.paragraph();