]> git.lyx.org Git - features.git/commitdiff
Fixed another undo buf (fix #256).
authorJürgen Vigna <jug@sad.it>
Thu, 7 Mar 2002 11:58:19 +0000 (11:58 +0000)
committerJürgen Vigna <jug@sad.it>
Thu, 7 Mar 2002 11:58:19 +0000 (11:58 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3687 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/text2.C
src/undo_funcs.C

index 226c93950879d4ca0c3d98b6a1dc153cb988e97f..83dafbe1fc3b1780acc742fdbb313864ca1454d9 100644 (file)
@@ -1,3 +1,8 @@
+2002-03-07  Juergen Vigna  <jug@sad.it>
+
+       * undo_funcs.C (textHandleUndo): fix problems when the paragraph
+       got moved away with the DEPM and also set the inset_owner always
+       right which before could have been omitted.
 2002-03-07  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
        * buffer.C (parseSingleLyXformat2Token): use default layout is the
index caed3ece552024c44af8e106d81da8d93c330068..de33573ee34bc77d1fb1e70d766256c075f38326 100644 (file)
@@ -2326,7 +2326,8 @@ bool LyXText::deleteEmptyParagraphMechanism(BufferView * bview,
                                            LyXCursor const & old_cursor) const
 {
        // Would be wrong to delete anything if we have a selection.
-       if (selection.set()) return false;
+       if (selection.set())
+               return false;
 
        // We allow all kinds of "mumbo-jumbo" when freespacing.
        if (textclasslist[bview->buffer()->params.textclass][
index dfd8d81c467de4bf8e1447a5500d793685b4d744..b60ee0c7fc13ceb4cc0ab2ca73d77e3cc9fc41a9 100644 (file)
@@ -143,6 +143,8 @@ bool textHandleUndo(BufferView * bv, Undo * undo)
                        Inset * in = 0;
                        if (before)
                                in = before->inInset();
+                       else if (undo->number_of_inset_id >= 0)
+                               in = bv->buffer()->getInsetFromID(undo->number_of_inset_id);
                        tmppar4->setInsetOwner(in);
                        while (tmppar4->next()) {
                                tmppar4 = tmppar4->next();
@@ -185,14 +187,17 @@ bool textHandleUndo(BufferView * bv, Undo * undo)
                        if (before)
                                before->next(tmppar3);
                        else
-                               bv->text->ownerParagraph(tmppar3->id(),
-                                                        tmppar3);
+                               bv->text->ownerParagraph(firstUndoParagraph(bv, undo->number_of_inset_id)->id(),
+                                                        tmppar3);
 
                        tmppar3->previous(before);
                } else {
-                       // Do we really enter here ??? (Jug)
+                       // We enter here on DELETE undo operations where we have to
+                       // substitue the second paragraph with the first if the removed
+                       // one is the first!
                        if (!before && behind) {
-                               bv->text->ownerParagraph(behind);
+                               bv->text->ownerParagraph(firstUndoParagraph(bv, undo->number_of_inset_id)->id(),
+                                                        behind);
                                tmppar3 = behind;
                        }
                }