2002-04-12 Juergen Vigna <jug@sad.it>
+ * text2.C (insertInset): freeze Undo after setUndo so that it is not
+ again called in insertChar().
+
* text.C (leftMargin): return LYX_PAPER_MARGIN if this row contains
an inset which uses the whole row!
(rightMargin): ditto.
+2002-04-12 Juergen Vigna <jug@sad.it>
+
+ * insettext.C (insertInset): remove unneeded code!
+
2002-04-08 Herbert Voss <voss@perce.de>
* insetgraphic.C (write): write the rotating angle as
return the_locking_inset->insertInset(bv, inset);
return false;
}
- bool clear = false;
- if (!lt) {
- lt = getLyXText(bv);
- clear = true;
- }
- setUndo(bv, Undo::FINISH, lt->cursor.par(), lt->cursor.par()->next());
- freezeUndo();
inset->setOwner(this);
hideInsetCursor(bv);
- lt->insertInset(bv, inset);
+ getLyXText(bv)->insertInset(bv, inset);
bv->fitCursor();
- if (clear)
- lt = 0;
updateLocal(bv, CURSOR_PAR|CURSOR, true);
- unFreezeUndo();
return true;
}
{
if (!cursor.par()->insetAllowed(inset->lyxCode()))
return;
- // I don't know if this is necessary here (Jug 20020102)
- setUndo(bview, Undo::INSERT, cursor.par(), cursor.par()->next());
+ setUndo(bview, Undo::FINISH, cursor.par(), cursor.par()->next());
+ freezeUndo();
cursor.par()->insertInset(cursor.pos(), inset);
// Just to rebreak and refresh correctly.
// The character will not be inserted a second time
insertChar(bview, Paragraph::META_INSET);
-#if 1
// If we enter a highly editable inset the cursor should be to before
// the inset. This couldn't happen before as Undo was not handled inside
// inset now after the Undo LyX tries to call inset->Edit(...) again
if (isHighlyEditableInset(inset)) {
cursorLeft(bview, true);
}
-#endif
+ unFreezeUndo();
}