summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-08-14 15:04:42 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-08-14 15:05:50 (GMT)
commit3c8f4512df30dee4a867a498fff6d2b27b881e4b (patch)
treef6cec8256c40fe72514cfbd304f1eb85bd916e4d /src/gui/text
parent533807d5c06be28694665fc889ec1942c59ab705 (diff)
downloadQt-3c8f4512df30dee4a867a498fff6d2b27b881e4b.zip
Qt-3c8f4512df30dee4a867a498fff6d2b27b881e4b.tar.gz
Qt-3c8f4512df30dee4a867a498fff6d2b27b881e4b.tar.bz2
QVariant: more work on avoinding conversion between float and doubles
we call QVariant::toReal instead of toDouble when needed
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtexthtmlparser.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp
index 8910394..92b2d4e 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)