From 902695800b7a760c138bc84ae982d5c5b826a437 Mon Sep 17 00:00:00 2001 From: Bibiko Date: Thu, 16 Sep 2010 12:09:35 +0000 Subject: =?UTF-8?q?=E2=80=A2=20BIT=20Field=20Sheet=20Editor=20now=20can=20?= =?UTF-8?q?handle=20NULL=20values=20=E2=80=A2=20Field=20Editor=20Sheet=20f?= =?UTF-8?q?ield=20name=20label=20also=20displays=20NOT=20NULL=20if=20set?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPTableContent.m | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Source/SPTableContent.m') diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index 99e34af1..cff8a675 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -3522,12 +3522,16 @@ NSString *fieldType = nil; NSUInteger *fieldLength = 0; NSString *fieldEncoding = nil; + BOOL allowNULL = YES; + // Retrieve the column defintion for(id c in cqColumnDefinition) { if([[c objectForKey:@"datacolumnindex"] isEqualToNumber:[aTableColumn identifier]]) { fieldType = [c objectForKey:@"type"]; if([c objectForKey:@"char_length"]) fieldLength = [[c objectForKey:@"char_length"] integerValue]; + if([c objectForKey:@"null"]) + allowNULL = (![[c objectForKey:@"null"] integerValue]); if([c objectForKey:@"charset_name"] && ![[c objectForKey:@"charset_name"] isEqualToString:@"binary"]) fieldEncoding = [c objectForKey:@"charset_name"]; break; @@ -3539,6 +3543,7 @@ [fieldEditor setTextMaxLength:fieldLength]; [fieldEditor setFieldType:(fieldType==nil) ? @"" : fieldType]; [fieldEditor setFieldEncoding:(fieldEncoding==nil) ? @"" : fieldEncoding]; + [fieldEditor setAllowNULL:allowNULL]; id cellValue = [tableValues cellDataAtRow:rowIndex column:[[aTableColumn identifier] integerValue]]; if ([cellValue isNSNull]) cellValue = [NSString stringWithString:[prefs objectForKey:SPNullValue]]; -- cgit v1.2.3