]> git.lyx.org Git - features.git/blobdiff - src/text2.C
Fixed various bugs + John's form paragraph bug.
[features.git] / src / text2.C
index abde4bd529207e3c2cd400747384331c7b8eab12..1440f91c561c231dfe5469c97ac90dd470d44efa 100644 (file)
@@ -391,6 +391,7 @@ void LyXText::removeRow(Row * row) const
                row->next()->previous(row->previous());
        if (!row->previous()) {
                firstrow = row->next();
+               lyx::Assert(firstrow);
        } else  {
                row->previous()->next(row->next());
        }
@@ -2366,6 +2367,10 @@ void LyXText::fixCursorAfterDelete(BufferView * bview,
 void LyXText::deleteEmptyParagraphMechanism(BufferView * bview,
                                            LyXCursor const & old_cursor) const
 {
+       // don't delete anything if this is the ONLY paragraph!
+       if (!old_cursor.par()->next() && !old_cursor.par()->previous())
+               return;
+       
        // Would be wrong to delete anything if we have a selection.
        if (selection.set()) return;