summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qcssparser.cpp
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-08-17 11:50:47 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-08-17 11:50:47 (GMT)
commit17d6f2a59fe2b170087cdf7074807c6a2dce1043 (patch)
tree64af0faa3146cd516b9887c9344ebd03408bafcc /src/gui/text/qcssparser.cpp
parent103334ced3b0cb6e69a1ed3075d9b81e591f37e9 (diff)
parent3d50220423b96a84f1ca4c0f5ef9246345aad359 (diff)
downloadQt-17d6f2a59fe2b170087cdf7074807c6a2dce1043.zip
Qt-17d6f2a59fe2b170087cdf7074807c6a2dce1043.tar.gz
Qt-17d6f2a59fe2b170087cdf7074807c6a2dce1043.tar.bz2
Merge commit 'qt/master' into kinetic-graphicseffect
Diffstat (limited to 'src/gui/text/qcssparser.cpp')
-rw-r--r--src/gui/text/qcssparser.cpp23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index db5ed7c..d3dcf50 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
+** contact the sales department at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -382,10 +382,7 @@ LengthData ValueExtractor::lengthValue(const Value& v)
if (data.unit != LengthData::None)
s.chop(2);
- bool ok;
- data.number = s.toDouble(&ok);
- if (!ok)
- data.number = 0;
+ data.number = s.toDouble();
return data;
}
@@ -711,7 +708,7 @@ static ColorData parseColorValue(Value v)
for (int i = 0; i < qMin(colorDigits.count(), 7); i += 2) {
if (colorDigits.at(i).type == Value::Percentage) {
- colorDigits[i].variant = colorDigits.at(i).variant.toDouble() * 255. / 100.;
+ colorDigits[i].variant = colorDigits.at(i).variant.toReal() * (255. / 100.);
colorDigits[i].type = Value::Number;
} else if (colorDigits.at(i).type != Value::Number) {
return ColorData();
@@ -788,19 +785,19 @@ static BrushData parseBrushValue(const Value &v, const QPalette &pal)
ColorData cd = parseColorValue(color);
if(cd.type == ColorData::Role)
dependsOnThePalette = true;
- stops.append(QGradientStop(stop.variant.toDouble(), colorFromData(cd, pal)));
+ stops.append(QGradientStop(stop.variant.toReal(), colorFromData(cd, pal)));
} else {
parser.next();
Value value;
- parser.parseTerm(&value);
+ (void)parser.parseTerm(&value);
if (attr.compare(QLatin1String("spread"), Qt::CaseInsensitive) == 0) {
spread = spreads.indexOf(value.variant.toString());
} else {
- vars[attr] = value.variant.toString().toDouble();
+ vars[attr] = value.variant.toReal();
}
}
parser.skipSpace();
- parser.test(COMMA);
+ (void)parser.test(COMMA);
}
if (gradType == 0) {
@@ -1079,8 +1076,8 @@ static bool setFontSizeFromValue(Value value, QFont *font, int *fontSizeAdjustme
if (s.endsWith(QLatin1String("pt"), Qt::CaseInsensitive)) {
s.chop(2);
value.variant = s;
- if (value.variant.convert(QVariant::Double)) {
- font->setPointSizeF(value.variant.toDouble());
+ if (value.variant.convert((QVariant::Type)qMetaTypeId<qreal>())) {
+ font->setPointSizeF(value.variant.toReal());
valid = true;
}
} else if (s.endsWith(QLatin1String("px"), Qt::CaseInsensitive)) {
@@ -2461,7 +2458,7 @@ bool Parser::parseAttrib(AttributeSelector *attr)
bool Parser::parsePseudo(Pseudo *pseudo)
{
- test(COLON);
+ (void)test(COLON);
pseudo->negated = test(EXCLAMATION_SYM);
if (test(IDENT)) {
pseudo->name = lexem();