From d09e3a2a855c80a5a69017a53a7d62e5324f0c26 Mon Sep 17 00:00:00 2001 From: bamse16 Date: Mon, 23 Mar 2009 19:31:11 +0000 Subject: Issue 201: Duplicating a row resets values of text/blob fields in the new row Changes after code review: renamed variable, replaced @"NULL" with [prefs objectForKey:@"nullValue"] --- Source/TableContent.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/TableContent.m b/Source/TableContent.m index bec112ff..69c1641a 100644 --- a/Source/TableContent.m +++ b/Source/TableContent.m @@ -694,13 +694,13 @@ if ( [[row objectForKey:@"Extra"] isEqualToString:@"auto_increment"] ) { [tempRow setObject:[prefs stringForKey:@"nullValue"] forKey:[row objectForKey:@"Field"]]; } else if ( [tableDataInstance columnIsBlobOrText:[row objectForKey:@"Field"]] && [prefs boolForKey:@"dontShowBlob"] && dbDataRow) { - NSString *nullValue = nil; + NSString *valueString = nil; //if what we read from DB is NULL (NSNull), we replace it with the string NULL if([[dbDataRow objectForKey:[row objectForKey:@"Field"]] isKindOfClass:[NSNull class]]) - nullValue = @"NULL"; + valueString = [prefs objectForKey:@"nullValue"]; else - nullValue = [dbDataRow objectForKey:[row objectForKey:@"Field"]]; - [tempRow setObject:nullValue forKey:[row objectForKey:@"Field"]]; + valueString = [dbDataRow objectForKey:[row objectForKey:@"Field"]]; + [tempRow setObject:valueString forKey:[row objectForKey:@"Field"]]; } } -- cgit v1.2.3