aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPCSVParser.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-03-22 14:56:05 +0000
committerBibiko <bibiko@eva.mpg.de>2010-03-22 14:56:05 +0000
commitdb2d9565c996e206d82a441cfd8e60627f0eab6d (patch)
treecddd29b39dfaac95062a9412f4a70786f1205171 /Source/SPCSVParser.m
parentf4e32dd6a24793454e0af44a4429cdd9ca737724 (diff)
downloadsequelpro-db2d9565c996e206d82a441cfd8e60627f0eab6d.tar.gz
sequelpro-db2d9565c996e206d82a441cfd8e60627f0eab6d.tar.bz2
sequelpro-db2d9565c996e206d82a441cfd8e60627f0eab6d.zip
• CSV Import
- if a parsed row in the csv file doesn't have the same number of columns as the first row fill the missing columns with SPNotLoaded to allow while importing that these missing data can be replaced by the table column's DEFAULT value - fixed tiny issue for field mapper sheet to display the correct tooltip for default values • SPTableData - ATTENTION: changed the object for returned key 'default': if its value is NULL now it returns a [NSNull null] object - changed instances to handle this [NSNull null] object (must be checked)
Diffstat (limited to 'Source/SPCSVParser.m')
-rw-r--r--Source/SPCSVParser.m6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/SPCSVParser.m b/Source/SPCSVParser.m
index d9a77a62..e4755a7e 100644
--- a/Source/SPCSVParser.m
+++ b/Source/SPCSVParser.m
@@ -24,6 +24,7 @@
// More info at <http://code.google.com/p/sequel-pro/>
#import "SPCSVParser.h"
+#import "SPNotLoaded.h"
/**
* Please see the header files for a general description of the purpose of this class.
@@ -294,11 +295,12 @@
}
// Capture the length of the first row when processing, and ensure that all
- // subsequent rows contain that many cells
+ // subsequent rows contain that many cells (fill them with [SPNotLoaded notLoaded]
+ // to allow to replace these by the table column's DEFAULT value)
if (fieldCount == NSNotFound) {
fieldCount = [csvRowArray count];
} else if ([csvRowArray count] < fieldCount) {
- for (j = [csvRowArray count]; j < fieldCount; j++) [csvRowArray addObject:[NSNull null]];
+ for (j = [csvRowArray count]; j < fieldCount; j++) [csvRowArray addObject:[SPNotLoaded notLoaded]];
}
// Return the row