Treat QTestFontEngine properly

Do not try to fill fontDef when it's a test font engine, otherwise
it will cause a crash because desc.family is 0.

Change-Id: I008b784bae3e60a25c33c285d944442a3616a9a2
Reviewed-on: http://codereview.qt-project.org/5103
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
This commit is contained in:
Jiang Jiang 2011-09-16 16:11:46 +02:00 committed by Qt by Nokia
parent e63b6f113c
commit 1aaf08691d

View File

@ -260,7 +260,7 @@ QFontDatabase::findFont(int script, const QFontPrivate *fp,
FM_DEBUG(" NO MATCH FOUND\n");
}
if (engine) {
if (engine && engine->type() != QFontEngine::TestFontEngine) {
initFontDef(desc, request, &engine->fontDef);
if (fp) {