diff src/converter.cpp @ 63:4d65e654abf7

Converter: Handle empty percent strings again
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 26 Aug 2016 12:24:32 +0200
parents 5410f9f279ea
children defd29b9f25a
line wrap: on
line diff
--- a/src/converter.cpp	Fri Aug 26 12:22:50 2016 +0200
+++ b/src/converter.cpp	Fri Aug 26 12:24:32 2016 +0200
@@ -230,7 +230,7 @@
                 bool ok;
                 QString percentStr = choiceMatch.captured("percent");
                 double percent;
-                if (percentStr.isNull()) {
+                if (percentStr.isEmpty()) {
                     percent = 0;
                     ok = true;
                 } else {
@@ -238,6 +238,9 @@
                 }
                 if (!ok) {
                     mErrors << "Unparsable number in string: " + choiceMatch.captured();
+                    percent = 0;
+                    percentStr = QString();
+                    /* PercentStr was not a number. */
                 }
                 makeBar(html, percent, doc);
                 xlsx.write(row, 2, percent == 0 ? QVariant() : percent);
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)