diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-18 14:31:07 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-05-18 14:31:07 (GMT) |
commit | f3988241faa59596c1702b31e7bec9538f33ee79 (patch) | |
tree | 39cc06b8455545cd1fd754c44838afcc3a0bdaac /src/gui/text | |
parent | 7e4d4474d10cb17047d95e3a4820388468c74507 (diff) | |
parent | 5c25207628fbcc94e92b129ac7660af14613ad85 (diff) | |
download | Qt-f3988241faa59596c1702b31e7bec9538f33ee79.zip Qt-f3988241faa59596c1702b31e7bec9538f33ee79.tar.gz Qt-f3988241faa59596c1702b31e7bec9538f33ee79.tar.bz2 |
Merge commit 'origin/4.5'
Conflicts:
src/corelib/kernel/qobject.cpp
src/corelib/kernel/qobject_p.h
src/network/access/qhttpnetworkconnection.cpp
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qcssparser.cpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index 8214e54..38621c1 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -1161,13 +1161,20 @@ static bool setFontWeightFromValue(const Value &value, QFont *font) return true; } -static bool setFontFamilyFromValues(const QVector<Value> &values, QFont *font) +/** \internal + * parse the font family from the values (starting from index \a start) + * and set it the \a font + * \returns true if a family was extracted. + */ +static bool setFontFamilyFromValues(const QVector<Value> &values, QFont *font, int start = 0) { QString family; - for (int i = 0; i < values.count(); ++i) { + for (int i = start; i < values.count(); ++i) { const Value &v = values.at(i); - if (v.type == Value::TermOperatorComma) - break; + if (v.type == Value::TermOperatorComma) { + family += QLatin1Char(','); + continue; + } const QString str = v.variant.toString(); if (str.isEmpty()) break; @@ -1221,9 +1228,7 @@ static void parseShorthandFontProperty(const QVector<Value> &values, QFont *font } if (i < values.count()) { - QString fam = values.at(i).variant.toString(); - if (!fam.isEmpty()) - font->setFamily(fam); + setFontFamilyFromValues(values, font, i); } } |