Fixes for undoing in the field editor. Added usage of NSCellUndoManager class.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38903 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Paul Landers 2015-08-17 17:41:37 +00:00
parent 71dd745382
commit 9bcec86989
4 changed files with 30 additions and 2 deletions

View file

@ -1137,6 +1137,7 @@ that makes decoding and encoding compatible with the old code.
DESTROY(_defaultParagraphStyle);
DESTROY(_linkTextAttributes);
DESTROY(_undoObject);
DESTROY(_fieldEditorUndoManager);
[super dealloc];
}
@ -1705,7 +1706,7 @@ to make sure syncing is handled properly in all cases.
[notificationCenter postNotificationName: NSTextDidEndEditingNotification
object: _notifObject];
if (_tf.is_field_editor)
if (_tf.is_field_editor && ![[self undoManager] isUndoing] && ![[self undoManager] isRedoing] )
{
[[self undoManager] removeAllActions];
}
@ -2603,12 +2604,25 @@ Move to NSTextView_actions.m?
if (![_delegate respondsToSelector: @selector(undoManagerForTextView:)]
|| ((undo = [_delegate undoManagerForTextView: self]) == nil))
{
undo = [super undoManager];
if (_fieldEditorUndoManager)
{
undo = _fieldEditorUndoManager;
}
else
{
undo = [super undoManager];
}
}
return undo;
}
-(void)_setFieldEditorUndoManager:(NSUndoManager *)undoManager
{
[_fieldEditorUndoManager autorelease];
_fieldEditorUndoManager = [undoManager retain];
}
/*
* Began editing flag. There are quite some different ways in which
* editing can be started. Each time editing is started, we need to check