diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-02-19 17:12:49 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-02-19 17:12:49 +0000 |
commit | 2583d511db232ca276c1718fbef871880c00625b (patch) | |
tree | 437a157de6eb4ce4677c0ee250ed41c74a3dce36 /Source/TableContent.m | |
parent | e82b66825a20ab9abb62a09cc29361af6343648b (diff) | |
download | sequelpro-2583d511db232ca276c1718fbef871880c00625b.tar.gz sequelpro-2583d511db232ca276c1718fbef871880c00625b.tar.bz2 sequelpro-2583d511db232ca276c1718fbef871880c00625b.zip |
• fixed color setting for editing a table cell which is set to NULL if table columns are reordered by the user
• initial transition to insert via - up to now - ^⇧N a [NSNull null] object into the table's data source directly without parsing a possible @"NULL" string
- it's a first test
- and works only for CMCopyTable subclassed tables
Diffstat (limited to 'Source/TableContent.m')
-rw-r--r-- | Source/TableContent.m | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Source/TableContent.m b/Source/TableContent.m index 3b22db96..4d878527 100644 --- a/Source/TableContent.m +++ b/Source/TableContent.m @@ -2718,7 +2718,9 @@ // If user wants to edit 'cell' set text color to black and return to avoid // writing in gray if value was NULL - if ( [aTableView editedColumn] == columnIndex && [aTableView editedRow] == rowIndex) { + if ([aTableView editedColumn] != -1 + && [aTableView editedRow] == rowIndex + && [[NSArrayObjectAtIndex([aTableView tableColumns], [aTableView editedColumn]) identifier] integerValue] == columnIndex) { [cell setTextColor:[NSColor blackColor]]; return; } @@ -2744,17 +2746,12 @@ } NSDictionary *column = NSArrayObjectAtIndex(dataColumns, [[aTableColumn identifier] integerValue]); - - if (anObject) { - - // Restore NULLs if necessary - if ([anObject isEqualToString:[prefs objectForKey:SPNullValue]] && [[column objectForKey:@"null"] boolValue]) - anObject = [NSNull null]; + if (anObject) [tableValues replaceObjectInRow:rowIndex column:[[aTableColumn identifier] integerValue] withObject:anObject]; - } else { + else [tableValues replaceObjectInRow:rowIndex column:[[aTableColumn identifier] integerValue] withObject:@""]; - } + } #pragma mark - |