From 2b950244a3615c2611a636afbf372411c9db491c Mon Sep 17 00:00:00 2001 From: Ariya Hidayat Date: Mon, 31 Aug 2009 15:15:19 +0200 Subject: Fix wrong checks in commit fd8ced2f. We should use the newly create QStringRef, after all that is the idea of the optimization. --- src/svg/qsvghandler.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index d0b52da..344e2b1 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -181,21 +181,21 @@ QSvgAttributes::QSvgAttributes(const QXmlStreamAttributes &xmlAttributes, QSvgHa case 's': 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()) + if (strokeRef.isEmpty()) stroke = value; - else if (name == QLatin1String("-dasharray")) + else if (strokeRef == QLatin1String("-dasharray")) strokeDashArray = value; - else if (name == QLatin1String("-dashoffset")) + else if (strokeRef == QLatin1String("-dashoffset")) strokeDashOffset = value; - else if (name == QLatin1String("-linecap")) + else if (strokeRef == QLatin1String("-linecap")) strokeLineCap = value; - else if (name == QLatin1String("-linejoin")) + else if (strokeRef == QLatin1String("-linejoin")) strokeLineJoin = value; - else if (name == QLatin1String("-miterlimit")) + else if (strokeRef == QLatin1String("-miterlimit")) strokeMiterLimit = value; - else if (name == QLatin1String("-opacity")) + else if (strokeRef == QLatin1String("-opacity")) strokeOpacity = value; - else if (name == QLatin1String("-width")) + else if (strokeRef == QLatin1String("-width")) strokeWidth = value; } else if (name == QLatin1String("stop-color")) @@ -276,21 +276,21 @@ QSvgAttributes::QSvgAttributes(const QXmlStreamAttributes &xmlAttributes, QSvgHa case 's': 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()) + if (strokeRef.isEmpty()) stroke = value; - else if (name == QLatin1String("-dasharray")) + else if (strokeRef == QLatin1String("-dasharray")) strokeDashArray = value; - else if (name == QLatin1String("-dashoffset")) + else if (strokeRef == QLatin1String("-dashoffset")) strokeDashOffset = value; - else if (name == QLatin1String("-linecap")) + else if (strokeRef == QLatin1String("-linecap")) strokeLineCap = value; - else if (name == QLatin1String("-linejoin")) + else if (strokeRef == QLatin1String("-linejoin")) strokeLineJoin = value; - else if (name == QLatin1String("-miterlimit")) + else if (strokeRef == QLatin1String("-miterlimit")) strokeMiterLimit = value; - else if (name == QLatin1String("-opacity")) + else if (strokeRef == QLatin1String("-opacity")) strokeOpacity = value; - else if (name == QLatin1String("-width")) + else if (strokeRef == QLatin1String("-width")) strokeWidth = value; } else if (name == QLatin1String("stop-color")) -- cgit v0.12