]> git.lyx.org Git - lyx.git/commitdiff
Fix the critical part of Bug 1255 and Bug 1256.
authorAlfredo Braunstein <abraunst@lyx.org>
Tue, 5 Aug 2003 22:00:04 +0000 (22:00 +0000)
committerAlfredo Braunstein <abraunst@lyx.org>
Tue, 5 Aug 2003 22:00:04 +0000 (22:00 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7511 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/text2.C

index 6a6771966156655191f3066c3c2149d27d28040b..dfe0a1c8e5f22465b0979c6530b43a0741f369ab 100644 (file)
@@ -1,3 +1,7 @@
+2003-08-05  Alfredo Braunstein  <abraunst@libero.it>
+
+       * text2.C (DEPM): fix part of bug 1255 and 1256 
+
 2003-08-05  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
 
        * BufferView_pimpl.C (workAreaDispatch): change to use
index 8377ed5abcbdc453c2118e21cd769832f80445d5..2cd1c61f69c6d82f85ac939cbfbfa9282cc5ea05 100644 (file)
@@ -1258,7 +1258,7 @@ void LyXText::cutSelection(bool doclear, bool realcut)
        }
 
        recordUndo(bv(), Undo::DELETE, selection.start.par(),
-               boost::prior(undoendpit));
+                  boost::prior(undoendpit));
 
 
        endpit = selection.end.par();
@@ -1281,10 +1281,6 @@ void LyXText::cutSelection(bool doclear, bool realcut)
                selection.start.par()->stripLeadingSpaces();
 
        redoParagraphs(selection.start.par(), boost::next(endpit));
-#warning FIXME latent bug
-       // endpit will be invalidated on redoParagraphs once ParagraphList
-       // becomes a std::list? There are maybe other places on which this
-       // can happend? (Ab)
        // cutSelection can invalidate the cursor so we need to set
        // it anew. (Lgb)
        // we prefer the end for when tracking changes
@@ -2065,9 +2061,11 @@ bool LyXText::deleteEmptyParagraphMechanism(LyXCursor const & old_cursor)
                    && old_cursor.pos() < old_cursor.par()->size()
                    && old_cursor.par()->isLineSeparator(old_cursor.pos())
                    && old_cursor.par()->isLineSeparator(old_cursor.pos() - 1)) {
-                       old_cursor.par()->erase(old_cursor.pos() - 1);
+                       bool erased = old_cursor.par()->erase(old_cursor.pos() - 1);
                        redoParagraph(old_cursor.par());
 
+                       if (!erased)
+                               return false;
 #ifdef WITH_WARNINGS
 #warning This will not work anymore when we have multiple views of the same buffer
 // In this case, we will have to correct also the cursors held by