* Source/NSTableView.m (-_isCellEditableColumn:row:): Tweak

criteria for determining cell editability::
- the delegate (if present) must say YES
- and the cell itself must return YES for isEditable
- and the table column must return YES for isEditable
Previously you could edit cells that returned NO for
isEditable if the column they were in was editable.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34320 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2011-12-19 00:18:58 +00:00
parent 0c1a040bda
commit d8ed82a8a8
2 changed files with 18 additions and 10 deletions

View file

@ -1,3 +1,13 @@
2011-12-18 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSTableView.m (-_isCellEditableColumn:row:): Tweak
criteria for determining cell editability::
- the delegate (if present) must say YES
- and the cell itself must return YES for isEditable
- and the table column must return YES for isEditable
Previously you could edit cells that returned NO for
isEditable if the column they were in was editable.
2011-12-18 Eric Wasylishen <ewasylishen@gmail.com>
* Source/NSTableHeaderView.m (-initWithCoder:): Remove unneeded

View file

@ -6530,17 +6530,15 @@ For a more detailed explanation, -setSortDescriptors:. */
row: (int) rowIndex
{
NSTableColumn *tableColumn;
NSTableColumn *tableColumn = [_tableColumns objectAtIndex: columnIndex];
NSCell *cell = [tableColumn dataCellForRow: rowIndex];
BOOL cellIsEditable = [cell isEditable];
BOOL columnIsEditable = [tableColumn isEditable];
BOOL delegateAllowsEditing = [self _shouldEditTableColumn: tableColumn
row: rowIndex];
tableColumn = [_tableColumns objectAtIndex: columnIndex];
// If the column is editable, the cell always is
if ([tableColumn isEditable])
{
// otherwise ask the delegate, if any.
return [self _shouldEditTableColumn: tableColumn row: rowIndex];
}
return NO;
return cellIsEditable && columnIsEditable && delegateAllowsEditing;
}
- (void) _willDisplayCell: (NSCell*)cell