aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorAbhi Beckert <me@abhibeckert.com>2016-06-20 07:16:51 +1000
committerAbhi Beckert <me@abhibeckert.com>2016-06-20 07:16:51 +1000
commitee78ced520cef27b67756232e2b86fc20f3b7cae (patch)
tree0acc9cf8c6585e8bb89cfaea340ea97ec5e9ccd1 /Source
parent50a0f185400bb4dd315000e3e7488798f0c48b23 (diff)
downloadsequelpro-ee78ced520cef27b67756232e2b86fc20f3b7cae.tar.gz
sequelpro-ee78ced520cef27b67756232e2b86fc20f3b7cae.tar.bz2
sequelpro-ee78ced520cef27b67756232e2b86fc20f3b7cae.zip
#2489 CSV export now treats header rows as non-numeric, even if the column is numeric
Diffstat (limited to 'Source')
-rw-r--r--Source/SPCSVExporter.m8
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/SPCSVExporter.m b/Source/SPCSVExporter.m
index 6657aa8f..d3ce39ad 100644
--- a/Source/SPCSVExporter.m
+++ b/Source/SPCSVExporter.m
@@ -232,6 +232,7 @@
}
// Retrieve the next row from the supplied data, either directly from the array...
+ BOOL forceNonNumericRow = NO;
if ([self csvDataArray]) {
csvRow = NSArrayObjectAtIndex([self csvDataArray], currentRowIndex);
}
@@ -241,6 +242,7 @@
if ([self csvOutputFieldNames]) {
csvRow = [streamingResult fieldNames];
[self setCsvOutputFieldNames:NO];
+ forceNonNumericRow = YES;
}
else {
csvRow = [streamingResult getRowAsArray];
@@ -298,8 +300,12 @@
[csvString appendString:[self csvEnclosingCharacterString]];
}
else {
+ // is this the header row?
+ if (forceNonNumericRow) {
+ csvCellIsNumeric = NO;
+ }
// If an array of bools supplying information as to whether the column is numeric has been supplied, use it.
- if ([tableColumnNumericStatus count] > 0) {
+ else if ([tableColumnNumericStatus count] > 0) {
csvCellIsNumeric = [NSArrayObjectAtIndex(tableColumnNumericStatus, i) boolValue];
}
// Otherwise, first test whether this cell contains data