Problem: 1660115

Title: (TCommandhandler) Aborting command doesn't remove it from undo/redo stack

Received: Jun 2 1997 3:00PM


If a command's DoIt method fails, the command is not removed from the undo/redo stack so it still appears in the Edit menu. Choosing Undo or Redo for the command has no effect.

TCommandHandler::PerformCommand calls TUndoHandler::Abort when DoIt fails. A comment in PerformCommand indicates that Abort frees the command but it does not because fInTransaction is zero when Abort executes and nothing is done.


Fix:

It does now. The code in TUndoHandler::Abortxxx was using a while loop but should have been using a do-while loop. Thus it caught the case of a transaction (like a drag move across contexts) but it ignored simple little old single commands.

Files Affected: Uundo.cp