From 566ede417f79704d9a2cc7f1650d33b8ce4ea287 Mon Sep 17 00:00:00 2001 From: gcasa Date: Sat, 22 Jan 2005 03:07:29 +0000 Subject: [PATCH] Futher improvements to NSUndoManager. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20593 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 9 +++++++++ Source/NSUndoManager.m | 8 ++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f2f9814b6..bebee7a94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-01-21 22:08 Gregory John Casamento + + * Source/NSUndoManager.m: [NSUndoManager redo] and + [NSUndoManager undoNestedGroup] moved the call to actionName + to a later point in both methods to get the name from the + "groupToRedo" or the "groupToUndo" respectively. This + corrects the issue with the wrong name sometimes appearing + in the redo/undo menu items. + 2005-01-16 07:59 Gregory John Casamento * Source/NSUndoManager.m: Added code to properly set the diff --git a/Source/NSUndoManager.m b/Source/NSUndoManager.m index e8aa2b06c..115084020 100644 --- a/Source/NSUndoManager.m +++ b/Source/NSUndoManager.m @@ -582,7 +582,7 @@ */ - (void) redo { - NSString *name = [NSString stringWithString: [self redoActionName]]; + NSString *name = nil; if (_isUndoing || _isRedoing) { @@ -604,6 +604,8 @@ groupToRedo = RETAIN([_redoStack lastObject]); [_redoStack removeLastObject]; + name = [NSString stringWithString: [groupToRedo actionName]]; + oldGroup = _group; _group = nil; _isRedoing = YES; @@ -965,7 +967,7 @@ */ - (void) undoNestedGroup { - NSString *name = [NSString stringWithString: [self undoActionName]]; + NSString *name = nil; PrivateUndoGroup *oldGroup; PrivateUndoGroup *groupToUndo; @@ -1011,6 +1013,8 @@ [_undoStack removeLastObject]; } + name = [NSString stringWithString: [groupToUndo actionName]]; + [self beginUndoGrouping]; [groupToUndo perform]; RELEASE(groupToUndo);