From 1aaf08691dd1e1a9b5124b2835aaf121ab2b370a Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Fri, 16 Sep 2011 16:11:46 +0200 Subject: [PATCH] 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 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfontdatabase_qpa.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp index c0edce1009..3a578e746f 100644 --- a/src/gui/text/qfontdatabase_qpa.cpp +++ b/src/gui/text/qfontdatabase_qpa.cpp @@ -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) {