diff options
author | Abhi Beckert <me@abhibeckert.com> | 2016-06-20 07:16:51 +1000 |
---|---|---|
committer | Abhi Beckert <me@abhibeckert.com> | 2016-06-20 07:16:51 +1000 |
commit | ee78ced520cef27b67756232e2b86fc20f3b7cae (patch) | |
tree | 0acc9cf8c6585e8bb89cfaea340ea97ec5e9ccd1 /Source | |
parent | 50a0f185400bb4dd315000e3e7488798f0c48b23 (diff) | |
download | sequelpro-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.m | 8 |
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 |