From 3cda2ab03af655389a84b011d2eba8904b9658b6 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Fri, 19 Dec 2014 06:38:06 +0400 Subject: [QFontDatabase] Don't look for best foundry twice In case the foundry name was empty and foundry lookup has failed, don't look for *any* foundry since it does exactly the same as previous call. Change-Id: I2a81949df06c31e1ae6999a6bbbe973408d4b814 Reviewed-by: Friedemann Kleint Reviewed-by: Pierre Rossi --- src/gui/text/qfontdatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index e465b9d9ca..89d2272828 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -1166,7 +1166,7 @@ static int match(int script, const QFontDef &request, bestFoundry(script, score, request.styleStrategy, test.family, foundry_name, styleKey, request.pixelSize, pitch, &test, force_encoding_id, request.styleName); - if (test.foundry == 0) { + if (test.foundry == 0 && !foundry_name.isEmpty()) { // the specific foundry was not found, so look for // any foundry matching our requirements newscore = bestFoundry(script, score, request.styleStrategy, test.family, -- cgit v1.2.3