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:
gcasa 2005-01-14 10:45:09 +00:00
parent e7ab49ec59
commit b0e6b71be7
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,18 +340,22 @@
{
if (_isUndoing)
{
if (_levelsOfUndo > 0 && [_redoStack count] == _levelsOfUndo)
if (_levelsOfUndo > 0 && [_redoStack count] == _levelsOfUndo && [[g actions] count] > 0)
{
[_redoStack removeObjectAtIndex: 0];
}
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];
}
if([[g actions] count] > 0)
[_undoStack addObject: g];
}
}