From 20ad5eaa3826dc8b5d1fb5496a3c6f49d802c632 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Mon, 3 Aug 2009 18:23:53 +0000 Subject: =?UTF-8?q?=E2=80=A2=20add=20Menu=20Item=20"Insert=20NULL=20value"?= =?UTF-8?q?=20SHIFT+CTRL+N=20-=20it=20inserts=20the=20value=20set=20in=20t?= =?UTF-8?q?he=20preferences=20=E2=80=A2=20a=20NULL=20value=20will=20be=20d?= =?UTF-8?q?isplayed=20greyed=20in=20the=20Custom=20Query=20result=20?= =?UTF-8?q?=E2=80=A2=20make=20usage=20of=20NSArrayObjectAtIndex()=20in=20T?= =?UTF-8?q?ableContent=20for=20tableView:willDisplayCell=20-=20and=20negat?= =?UTF-8?q?ed=20the=20NULL=20checking=20for=20column=20(is=20NULL=20allowe?= =?UTF-8?q?d)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/TableContent.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/TableContent.m') diff --git a/Source/TableContent.m b/Source/TableContent.m index 18cd8e78..93929d00 100644 --- a/Source/TableContent.m +++ b/Source/TableContent.m @@ -1873,7 +1873,7 @@ */ - (void)tableView:(CMCopyTable *)aTableView willDisplayCell:(id)cell forTableColumn:(NSTableColumn*)aTableColumn row:(int)row { - NSDictionary *column = [dataColumns objectAtIndex:[[aTableColumn identifier] intValue]]; + NSDictionary *column = NSArrayObjectAtIndex(dataColumns, [[aTableColumn identifier] intValue]); // For NULL cell's display the user's NULL value placeholder in grey to easily distinguish it from other values if ([cell respondsToSelector:@selector(setTextColor:)]) { @@ -1882,7 +1882,7 @@ // of the user's NULL value preference which was set in the result array when it was retrieved (see fetchResultAsArray). // Also, as an added measure check that the table column actually allows NULLs to make sure we don't change a cell that // happens to have a value matching the NULL placeholder, but the column doesn't allow NULLs. - [cell setTextColor:([[cell stringValue] isEqualToString:[prefs objectForKey:@"NullValue"]] && [[column objectForKey:@"null"] boolValue]) ? [NSColor lightGrayColor] : [NSColor blackColor]]; + [cell setTextColor:([[cell stringValue] isEqualToString:[prefs objectForKey:@"NullValue"]] && ![[column objectForKey:@"null"] boolValue]) ? [NSColor lightGrayColor] : [NSColor blackColor]]; } // Check if loading of text/blob fields is disabled -- cgit v1.2.3