diff options
author | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-08-19 11:57:27 (GMT) |
---|---|---|
committer | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-08-19 11:57:27 (GMT) |
commit | d9e03376f9f82e5664dfd2446ff4c05e35ffb535 (patch) | |
tree | 711f77f7d307c05a3ae310b1fd59bbce74bd8eab /src/gui/text/qcssparser.cpp | |
parent | 98d4c657803d5f1956560bd9b62e73f15c05e8fd (diff) | |
parent | ca0b5b503e8865c0eedeea86aa132291281fc49f (diff) | |
download | Qt-d9e03376f9f82e5664dfd2446ff4c05e35ffb535.zip Qt-d9e03376f9f82e5664dfd2446ff4c05e35ffb535.tar.gz Qt-d9e03376f9f82e5664dfd2446ff4c05e35ffb535.tar.bz2 |
Merged in DummyPlayer changes
Diffstat (limited to 'src/gui/text/qcssparser.cpp')
-rw-r--r-- | src/gui/text/qcssparser.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index 99374b5..fcc26d6 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$ ** ****************************************************************************/ @@ -383,10 +383,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; } @@ -712,7 +709,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(); @@ -789,19 +786,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) { @@ -1080,8 +1077,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)) { @@ -2462,7 +2459,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(); |