diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-03-22 10:12:59 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-03-22 10:12:59 +0000 |
commit | f4e32dd6a24793454e0af44a4429cdd9ca737724 (patch) | |
tree | 5c8964aa14c0885e10b6d45a0efa3503a5b28590 /Source/SPFieldMapperController.m | |
parent | 1c037fd0f3014833dd3c47d5c1b30d0e525536db (diff) | |
download | sequelpro-f4e32dd6a24793454e0af44a4429cdd9ca737724.tar.gz sequelpro-f4e32dd6a24793454e0af44a4429cdd9ca737724.tar.bz2 sequelpro-f4e32dd6a24793454e0af44a4429cdd9ca737724.zip |
• fixed bug while CSV import
- calculate correctly whether global variables are used or not to avoid a crash if the number of columns in the csv file differs
Diffstat (limited to 'Source/SPFieldMapperController.m')
-rw-r--r-- | Source/SPFieldMapperController.m | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Source/SPFieldMapperController.m b/Source/SPFieldMapperController.m index 9483161b..c8f2c90b 100644 --- a/Source/SPFieldMapperController.m +++ b/Source/SPFieldMapperController.m @@ -212,11 +212,27 @@ return fieldMappingGlobalValues; } +- (BOOL)globalValuesInUsage +{ + NSInteger i = 0; + for(id item in fieldMappingArray) { + if([item intValue] >= numberOfImportColumns && [fieldMappingOperatorArray objectAtIndex:i] != doNotImport) + return YES; + i++; + } + return NO; +} + - (NSArray*)fieldMappingTableColumnNames { return fieldMappingTableColumnNames; } +- (NSArray*)fieldMappingTableDefaultValues +{ + return fieldMappingTableDefaultValues; +} + - (BOOL)importFieldNamesHeader { return ([importFieldNamesHeaderSwitch state] == NSOnState)?YES:NO; @@ -335,7 +351,7 @@ if ([column objectForKey:@"default"]) [fieldMappingTableDefaultValues addObject:[column objectForKey:@"default"]]; else - [fieldMappingTableDefaultValues addObject:@"NULL"]; + [fieldMappingTableDefaultValues addObject:[NSNull null]]; } [fieldMappingTableTypes addObject:[NSString stringWithString:type]]; |