From e30065a82e00081ef49fc3152def9991abd149a8 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 10 Apr 2017 09:57:47 +0200 Subject: Correctly parse the stroke-dasharray attributes When a stroke-dasharray had multiple values separated by spaces it would end up combining them into one instead of treating them separately. This ensures that it is correctly respected. [ChangeLog] Parses the stroke-dasharray attributes in a SVG file correctly. Change-Id: If6e9babe9f63637e56d3d1dba914557829f9d5f0 Reviewed-by: Eirik Aavitsland --- src/svg/qsvghandler.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index c40091f..c4e2b03 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -1912,13 +1912,12 @@ static void parseCSStoXMLAttrs(const QVector &declarations, continue; QCss::Value val = decl.d->values.first(); QString valueStr; - if (decl.d->values.count() != 1) { - for (int i=0; ivalues.count(); ++i) { - const QString &value = decl.d->values[i].toString(); - if (value.isEmpty()) + const int valCount = decl.d->values.count(); + if (valCount != 1) { + for (int i = 0; i < valCount; ++i) { + valueStr += decl.d->values[i].toString(); + if (i + 1 < valCount) valueStr += QLatin1Char(','); - else - valueStr += value; } } else { valueStr = val.toString(); -- cgit v1.2.1