updateLevel--;
if (!endingUpdate)
{
endingUpdate = updateLevel == 0;
fireEvent(new mxEventObject(mxEvent.END_UPDATE, "edit", currentEdit));
try
{
if (endingUpdate && !currentEdit.isEmpty())
{
fireEvent(new mxEventObject(mxEvent.BEFORE_UNDO, "edit",
currentEdit));
mxUndoableEdit tmp = currentEdit;
currentEdit = createUndoableEdit();
tmp.dispatch();
fireEvent(new mxEventObject(mxEvent.UNDO, "edit", tmp));
}
}
finally
{
endingUpdate = false;