diff options
-rw-r--r-- | src/svg/qsvghandler.cpp | 70 |
1 files changed, 38 insertions, 32 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index b8266f7138..c06a1d4d3e 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -179,22 +179,25 @@ QSvgAttributes::QSvgAttributes(const QXmlStreamAttributes &xmlAttributes, QSvgHa break; case 's': - if (name == QLatin1String("stroke")) - stroke = value; - else if (name == QLatin1String("stroke-dasharray")) - strokeDashArray = value; - else if (name == QLatin1String("stroke-dashoffset")) - strokeDashOffset = value; - else if (name == QLatin1String("stroke-linecap")) - strokeLineCap = value; - else if (name == QLatin1String("stroke-linejoin")) - strokeLineJoin = value; - else if (name == QLatin1String("stroke-miterlimit")) - strokeMiterLimit = value; - else if (name == QLatin1String("stroke-opacity")) - strokeOpacity = value; - else if (name == QLatin1String("stroke-width")) - strokeWidth = value; + if (name.length() > 5 && QStringRef(name.string(), name.position() + 1, 5) == QLatin1String("troke")) { + QStringRef strokeRef(name.string(), name.position() + 6, name.length() - 6); + if (name.isEmpty()) + stroke = value; + else if (name == QLatin1String("-dasharray")) + strokeDashArray = value; + else if (name == QLatin1String("-dashoffset")) + strokeDashOffset = value; + else if (name == QLatin1String("-linecap")) + strokeLineCap = value; + else if (name == QLatin1String("-linejoin")) + strokeLineJoin = value; + else if (name == QLatin1String("-miterlimit")) + strokeMiterLimit = value; + else if (name == QLatin1String("-opacity")) + strokeOpacity = value; + else if (name == QLatin1String("-width")) + strokeWidth = value; + } else if (name == QLatin1String("stop-color")) stopColor = value; else if (name == QLatin1String("stop-opacity")) @@ -271,22 +274,25 @@ QSvgAttributes::QSvgAttributes(const QXmlStreamAttributes &xmlAttributes, QSvgHa break; case 's': - if (name == QLatin1String("stroke")) - stroke = value; - else if (name == QLatin1String("stroke-dasharray")) - strokeDashArray = value; - else if (name == QLatin1String("stroke-dashoffset")) - strokeDashOffset = value; - else if (name == QLatin1String("stroke-linecap")) - strokeLineCap = value; - else if (name == QLatin1String("stroke-linejoin")) - strokeLineJoin = value; - else if (name == QLatin1String("stroke-miterlimit")) - strokeMiterLimit = value; - else if (name == QLatin1String("stroke-opacity")) - strokeOpacity = value; - else if (name == QLatin1String("stroke-width")) - strokeWidth = value; + if (name.length() > 5 && QStringRef(name.string(), name.position() + 1, 5) == QLatin1String("troke")) { + QStringRef strokeRef(name.string(), name.position() + 6, name.length() - 6); + if (name.isEmpty()) + stroke = value; + else if (name == QLatin1String("-dasharray")) + strokeDashArray = value; + else if (name == QLatin1String("-dashoffset")) + strokeDashOffset = value; + else if (name == QLatin1String("-linecap")) + strokeLineCap = value; + else if (name == QLatin1String("-linejoin")) + strokeLineJoin = value; + else if (name == QLatin1String("-miterlimit")) + strokeMiterLimit = value; + else if (name == QLatin1String("-opacity")) + strokeOpacity = value; + else if (name == QLatin1String("-width")) + strokeWidth = value; + } else if (name == QLatin1String("stop-color")) stopColor = value; else if (name == QLatin1String("stop-opacity")) |