diff options
author | Ariya Hidayat <ariya.hidayat@nokia.com> | 2009-09-02 08:11:20 (GMT) |
---|---|---|
committer | Ariya Hidayat <ariya.hidayat@nokia.com> | 2009-09-02 11:04:56 (GMT) |
commit | b9759ebf04618c311004ee4fd975b7fa7e47ed5e (patch) | |
tree | fd5b46e51517ab1257876f4af0845ff8ddab11cd | |
parent | 5cbfc76f607caaefe59489e4985cbac37d5c714d (diff) | |
download | Qt-b9759ebf04618c311004ee4fd975b7fa7e47ed5e.zip Qt-b9759ebf04618c311004ee4fd975b7fa7e47ed5e.tar.gz Qt-b9759ebf04618c311004ee4fd975b7fa7e47ed5e.tar.bz2 |
Use QStringRef when parsing SVG color opacity.
Reviewed-by: Kim
-rw-r--r-- | src/svg/qsvghandler.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/svg/qsvghandler.cpp b/src/svg/qsvghandler.cpp index 9e46048..28a96de 100644 --- a/src/svg/qsvghandler.cpp +++ b/src/svg/qsvghandler.cpp @@ -742,7 +742,7 @@ static bool resolveColor(const QString &colorStr, QColor &color, QSvgHandler *ha return color.isValid(); } -static bool constructColor(const QString &colorStr, const QString &opacity, +static bool constructColor(const QString &colorStr, const QStringRef &opacity, QColor &color, QSvgHandler *handler) { if (!resolveColor(colorStr, color, handler)) @@ -856,9 +856,8 @@ static void parseColor(QSvgNode *, QSvgHandler *handler) { QString colorStr = attributes.color.toString(); - QString opacity = attributes.colorOpacity.toString(); QColor color; - if (constructColor(colorStr, opacity, color, handler)) { + if (constructColor(colorStr, attributes.colorOpacity, color, handler)) { handler->pushColor(color); } } @@ -2903,10 +2902,10 @@ static QSvgStyleProperty *createSolidColorNode(QSvgNode *parent, { Q_UNUSED(parent); Q_UNUSED(attributes); QString solidColorStr = attributes.value(QLatin1String("solid-color")).toString(); - QString solidOpacityStr = attributes.value(QLatin1String("solid-opacity")).toString(); + QStringRef solidOpacityStr = attributes.value(QLatin1String("solid-opacity")); if (solidOpacityStr.isEmpty()) - solidOpacityStr = attributes.value(QLatin1String("opacity")).toString(); + solidOpacityStr = attributes.value(QLatin1String("opacity")); QColor color; if (!constructColor(solidColorStr, solidOpacityStr, color, handler)) @@ -2958,7 +2957,6 @@ static bool parseStopNode(QSvgStyleProperty *parent, static_cast<QSvgGradientStyle*>(parent); QString offsetStr = attrs.offset.toString(); QString colorStr = attrs.stopColor.toString(); - QString opacityStr = attrs.stopOpacity.toString(); QColor color; bool ok = true; @@ -2969,7 +2967,7 @@ static bool parseStopNode(QSvgStyleProperty *parent, colorStr = QLatin1String("#000000"); } - constructColor(colorStr, opacityStr, color, handler); + constructColor(colorStr, attrs.stopOpacity, color, handler); QGradient *grad = style->qgradient(); |