changeset 1871:bed42ce4d3ab csv-import-headers

Include the header row in the example output after all - it's less confusing I think to have it displayed (but e.g. italicised) than to have it appear and disappear
author Chris Cannam
date Thu, 18 Jun 2020 11:55:17 +0100
parents 1b8c4ee06f6d
children 566476eeeb80
files data/fileio/CSVFormat.cpp
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/data/fileio/CSVFormat.cpp	Wed Jun 17 18:01:00 2020 +0100
+++ b/data/fileio/CSVFormat.cpp	Thu Jun 18 11:55:17 2020 +0100
@@ -260,10 +260,11 @@
         // Start again with the qualities:
         m_columnQualities.clear();
         m_prevValues.clear();
-    } else if (lineno < firstLine + 10) {
-        // Not a header row, so add it to the example column output
+    }
+
+    if (lineno < firstLine + 10) {
         m_example.push_back(list);
-        if (lineno == firstLine || cols > m_maxExampleCols) {
+        if (lineno == 0 || cols > m_maxExampleCols) {
             m_maxExampleCols = cols;
         }
     }