Corrected problem with undo.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20550 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2005-01-14 10:45:09 +00:00
parent 00e4fbc778
commit 38bd9809e8
2 changed files with 13 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2005-01-14 05:43 Gregory John Casamento <greg_casamento@yahoo.com>
* Source/NSUndoManager.m: Fix forward invocation to not add
a group when it doesn't contain any actions.
2005-01-08 Adam Fedor <fedor@gnu.org>
* Source/NSCalendarDate.m: fix time zone for %z format with

View file

@ -340,19 +340,23 @@
{
if (_isUndoing)
{
if (_levelsOfUndo > 0 && [_redoStack count] == _levelsOfUndo)
if (_levelsOfUndo > 0 && [_redoStack count] == _levelsOfUndo && [[g actions] count] > 0)
{
[_redoStack removeObjectAtIndex: 0];
}
[_redoStack addObject: g];
if([[g actions] count] > 0)
[_redoStack addObject: g];
}
else
{
if (_levelsOfUndo > 0 && [_undoStack count] == _levelsOfUndo)
if (_levelsOfUndo > 0 && [_undoStack count] == _levelsOfUndo && [[g actions] count] > 0)
{
[_undoStack removeObjectAtIndex: 0];
}
[_undoStack addObject: g];
if([[g actions] count] > 0)
[_undoStack addObject: g];
}
}
else if ([g actions] != nil)