+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
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][
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();
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;
}
}