* Source/NSTableView.m (-mouseDown:): Copy the selected cell before

tracking mouse, add comment. (patch previously reverted 2005-05-30)
(-mouseDown:): Check for pointer equality in addition to isEqual:
        which doesn't work with nil. (fix for bug #15316)


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@22230 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Matt Rice 2005-12-31 13:50:30 +00:00
parent bcd0ed2914
commit 9bb51c5a9d
2 changed files with 14 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2005-12-31 Matt Rice <ratmice@yahoo.com>
* Source/NSTableView.m (-mouseDown:): Copy the selected cell before
tracking mouse, add comment. (patch previously reverted 2005-05-30)
(-mouseDown:): Check for pointer equality in addition to isEqual:
which doesn't work with nil. (fix for bug #15316)
2005-12-22 Adam Fedor <fedor@gnu.org>
* Version 0.10.2

View file

@ -3460,8 +3460,10 @@ static inline float computePeriod(NSPoint mouseLocationWin,
// Prepare the cell
tb = [_tableColumns objectAtIndex: _clickedColumn];
// It is unclear, if we should copy the cell here, as we do on editing.
cell = [tb dataCellForRow: _clickedRow];
/* we should copy the cell here, as we do on editing.
otherwise validation on a cell being edited could
cause the cell we are selecting to get it's objectValue */
cell = [[tb dataCellForRow: _clickedRow] copy];
originalValue = RETAIN([self _objectValueForTableColumn:tb row:_clickedRow]);
[cell setObjectValue: originalValue];
cellFrame = [self frameOfCellAtColumn: _clickedColumn
@ -3479,7 +3481,8 @@ static inline float computePeriod(NSPoint mouseLocationWin,
{
id newValue = [cell objectValue];
if ([tb isEditable] && ![originalValue isEqual: newValue])
if ([tb isEditable] && originalValue != newValue
&& ![originalValue isEqual: newValue])
{
[self _setObjectValue: newValue
forTableColumn: tb
@ -3498,6 +3501,7 @@ static inline float computePeriod(NSPoint mouseLocationWin,
}
RELEASE(originalValue);
[cell setHighlighted: NO];
RELEASE(cell);
[self setNeedsDisplayInRect: cellFrame];
lastEvent = [NSApp currentEvent];
}