From 7008bfe80e0466ed2978b39e7e698bbd52fb690f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Trond=20Kjern=C3=A5sen?= Date: Mon, 18 May 2009 13:05:14 +0200 Subject: Fixed the SVG parser to handle CSS properties with multiple values. CSS properties with more than 1 value was ignored. E.g. the 'stroke-dasharray' attribute is specified by a comma separates list of numbers. This was previously ignored because the CSS parser split it into a value array. Task-number: 253614 Reviewed-by: Kim --- src/svg/qsvghandler.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 433a3ad..6a897e8 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -1673,10 +1673,19 @@ static void parseCSStoXMLAttrs(const QVector &declarations, const QCss::Declaration &decl = declarations.at(i); if (decl.d->property.isEmpty()) continue; - if (decl.d->values.count() != 1) - continue; QCss::Value val = decl.d->values.first(); - QString valueStr = val.toString(); + 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()) + valueStr += QLatin1Char(','); + else + valueStr += value; + } + } else { + valueStr = val.toString(); + } if (val.type == QCss::Value::Uri) { valueStr.prepend(QLatin1String("url(")); valueStr.append(QLatin1Char(')')); -- cgit v0.12