mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 10:40:47 +00:00
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:
parent
71dd745382
commit
9bcec86989
4 changed files with 30 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue