]> git.lyx.org Git - lyx.git/blobdiff - src/undo_funcs.C
don't draw invisible things...
[lyx.git] / src / undo_funcs.C
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;
                        }
                }