mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 16:20:46 +00:00
Only invoke 'setObjectValue' from NSTableView if new value id diff from current/old value
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@40347 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
f2640b018f
commit
b7222b06f9
1 changed files with 32 additions and 26 deletions
|
@ -3322,21 +3322,24 @@ byExtendingSelection: (BOOL)flag
|
|||
{
|
||||
NSString *error;
|
||||
|
||||
if ([formatter getObjectValue: &newObjectValue
|
||||
forString: string
|
||||
errorDescription: &error] == YES)
|
||||
if ([formatter getObjectValue: &newObjectValue
|
||||
forString: string
|
||||
errorDescription: &error] == YES)
|
||||
{
|
||||
[_editedCell setObjectValue: newObjectValue];
|
||||
|
||||
if (_dataSource_editable)
|
||||
if ([[_editedCell objectValue] isEqual: newObjectValue] == NO)
|
||||
{
|
||||
NSTableColumn *tb;
|
||||
|
||||
tb = [_tableColumns objectAtIndex: _editedColumn];
|
||||
[_editedCell setObjectValue: newObjectValue];
|
||||
|
||||
[self _setObjectValue: newObjectValue
|
||||
forTableColumn: tb
|
||||
row: _editedRow];
|
||||
if (_dataSource_editable)
|
||||
{
|
||||
NSTableColumn *tb;
|
||||
|
||||
tb = [_tableColumns objectAtIndex: _editedColumn];
|
||||
|
||||
[self _setObjectValue: newObjectValue
|
||||
forTableColumn: tb
|
||||
row: _editedRow];
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -3364,22 +3367,25 @@ byExtendingSelection: (BOOL)flag
|
|||
// Generate an attributed string per Cocoa behavior...
|
||||
id object = string;
|
||||
|
||||
if ([_editedCell allowsEditingTextAttributes])
|
||||
{
|
||||
NSTextView *textView = (NSTextView*)_textObject;
|
||||
object = AUTORELEASE([[NSAttributedString alloc] initWithAttributedString:[textView textStorage]]);
|
||||
}
|
||||
|
||||
[_editedCell setObjectValue: object];
|
||||
|
||||
if (_dataSource_editable)
|
||||
if ([[_editedCell objectValue] isEqual: object] == NO)
|
||||
{
|
||||
// Need to pass string or attributedString based on cell settings...
|
||||
NSTableColumn *tb = [_tableColumns objectAtIndex: _editedColumn];
|
||||
if ([_editedCell allowsEditingTextAttributes])
|
||||
{
|
||||
NSTextView *textView = (NSTextView*)_textObject;
|
||||
object = AUTORELEASE([[NSAttributedString alloc] initWithAttributedString:[textView textStorage]]);
|
||||
}
|
||||
|
||||
[self _setObjectValue: object // newObjectValue
|
||||
forTableColumn: tb
|
||||
row: _editedRow];
|
||||
[_editedCell setObjectValue: object];
|
||||
|
||||
if (_dataSource_editable)
|
||||
{
|
||||
// Need to pass string or attributedString based on cell settings...
|
||||
NSTableColumn *tb = [_tableColumns objectAtIndex: _editedColumn];
|
||||
|
||||
[self _setObjectValue: object // newObjectValue
|
||||
forTableColumn: tb
|
||||
row: _editedRow];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue