/** * Returns the the next significant edit to be undone if undo is * called. May return null */ protected IUndoableEdit EditToBeUndone() { int i = indexOfNextAdd; while (i > 0) { IUndoableEdit edit = edits[--i]; if (edit.isSignificant()) { return(edit); } } return(null); }
/** * Returns the the next significant edit to be redone if redo is * called. May return null. * <b>Changes:</b> it return the last insignificant <code>Undoable</code> object, so * the <code>redo</code> method redo all <code>Undoable</code> objects up to <code>EditToBeRedone</code>. */ protected IUndoableEdit EditToBeRedone() { int count = edits.Count; int i = indexOfNextAdd; while (i < count) { IUndoableEdit edit = edits[i++]; if (i >= count) { return(edit); } IUndoableEdit nextEdit = edits[i]; if (nextEdit.isSignificant()) { return(edit); } } return(null); }