diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2009-05-18 11:05:14 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond@trolltech.com> | 2009-05-18 11:34:59 (GMT) |
commit | 7008bfe80e0466ed2978b39e7e698bbd52fb690f (patch) | |
tree | 1713a597f950b211a5fd4687d477ce9f637f90b1 /src | |
parent | cfcf72970cd58282aff9aac76f421915d287dc09 (diff) | |
download | Qt-7008bfe80e0466ed2978b39e7e698bbd52fb690f.zip Qt-7008bfe80e0466ed2978b39e7e698bbd52fb690f.tar.gz Qt-7008bfe80e0466ed2978b39e7e698bbd52fb690f.tar.bz2 |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/svg/qsvghandler.cpp | 15 |
1 files 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<QCss::Declaration> &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; i<decl.d->values.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(')')); |