summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNorwegian Rock Cat <qt-info@nokia.com>2009-06-02 14:09:58 (GMT)
committerJason McDonald <jason.mcdonald@nokia.com>2009-06-03 02:47:13 (GMT)
commitda139a9dd0f4df8009d7cd86ab25b2b4b19dfd96 (patch)
tree1d9200e5febf3a3e3dd35f2430153ce447093233
parenta37dd54265d302c96931d6b52b28d386c06b24e4 (diff)
downloadQt-da139a9dd0f4df8009d7cd86ab25b2b4b19dfd96.zip
Qt-da139a9dd0f4df8009d7cd86ab25b2b4b19dfd96.tar.gz
Qt-da139a9dd0f4df8009d7cd86ab25b2b4b19dfd96.tar.bz2
BT: Remove duplicate code and fix font parsing.
QFont has a feature that you can pass a comma-separated list and it will walk through the list and match the font that it hits first. There's a nice static function that X11 and Windows uses, but the Mac was using an older copied version of it. This old version didn't handle quoting which is what happens in the style sheet. So, using the same code makes everything work well. As a bonus, Creator looks correct again. Reviewed-by: Simon Hausmann (cherry picked from commit ad46e77420449ede2cb6c1ea2a810a2614520db9)
-rw-r--r--src/gui/text/qfontdatabase.cpp2
-rw-r--r--src/gui/text/qfontdatabase_mac.cpp9
2 files changed, 2 insertions, 9 deletions
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index d0b2280..a590664 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -827,6 +827,7 @@ static void getEngineData(const QFontPrivate *d, const QFontCache::Key &key)
d->engineData->ref.ref();
}
}
+#endif
static QStringList familyList(const QFontDef &req)
{
@@ -855,7 +856,6 @@ static QStringList familyList(const QFontDef &req)
return family_list;
}
-#endif
Q_GLOBAL_STATIC(QFontDatabasePrivate, privateDb)
Q_GLOBAL_STATIC_WITH_ARGS(QMutex, fontDatabaseMutex, (QMutex::Recursive))
diff --git a/src/gui/text/qfontdatabase_mac.cpp b/src/gui/text/qfontdatabase_mac.cpp
index f8fb8cb..23d2422 100644
--- a/src/gui/text/qfontdatabase_mac.cpp
+++ b/src/gui/text/qfontdatabase_mac.cpp
@@ -281,14 +281,7 @@ void QFontDatabase::load(const QFontPrivate *d, int script)
}
//find the font
- QStringList family_list = req.family.split(QLatin1Char(','));
- // append the substitute list for each family in family_list
- {
- QStringList subs_list;
- for(QStringList::ConstIterator it = family_list.constBegin(); it != family_list.constEnd(); ++it)
- subs_list += QFont::substitutes(*it);
- family_list += subs_list;
- }
+ QStringList family_list = familyList(req);
const char *stylehint = styleHint(req);
if (stylehint)