summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtexthtmlparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text/qtexthtmlparser.cpp')
-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)