diff options
author | David Boddie <dboddie@trolltech.com> | 2009-08-14 17:18:48 +0200 |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2009-08-14 17:18:48 +0200 |
commit | 9db9c1f2215e32047c7329ab769d54dd3c1ddeb7 (patch) | |
tree | 98acb9a60cf237138f939b5dadb0d9ae7722ddeb /src/gui/text/qtexthtmlparser.cpp | |
parent | e9d32707afeddfdd2906af7bed60c375b1035dd6 (diff) | |
parent | 3c8f4512df30dee4a867a498fff6d2b27b881e4b (diff) |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/gui/text/qtexthtmlparser.cpp')
-rw-r--r-- | src/gui/text/qtexthtmlparser.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index 8910394dc..92b2d4ee9 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -1443,14 +1443,13 @@ static bool setFloatAttribute(qreal *destination, const QString &value) static void setWidthAttribute(QTextLength *width, QString value) { - qreal realVal; bool ok = false; - realVal = value.toDouble(&ok); + qreal realVal = value.toDouble(&ok); if (ok) { *width = QTextLength(QTextLength::FixedLength, realVal); } else { value = value.trimmed(); - if (!value.isEmpty() && value.at(value.length() - 1) == QLatin1Char('%')) { + if (!value.isEmpty() && value.endsWith(QLatin1Char('%'))) { value.chop(1); realVal = value.toDouble(&ok); if (ok) |