Only compare styleNames if they are not empty
authorJiang Jiang <jiang.jiang@nokia.com>
Mon, 27 Jun 2011 08:15:39 +0000 (10:15 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 27 Jun 2011 10:22:24 +0000 (12:22 +0200)
Task-number: QTBUG-19366
(cherry picked from commit 15e6ac8f4d9e7a419cd0c10405954bde78559fac)

Change-Id: I5f06bb5133f23dbc8ad6d745d44ca0a85ef49686
Reviewed-on: http://codereview.qt.nokia.com/760
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
src/gui/text/qfont.cpp
src/gui/text/qfont_p.h

index e771b07..2d6af3b 100644 (file)
@@ -147,7 +147,7 @@ bool QFontDef::exactMatch(const QFontDef &other) const
             && weight        == other.weight
             && style        == other.style
             && this_family   == other_family
-            && styleName     == other.styleName
+            && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName)
             && (this_foundry.isEmpty()
                 || other_foundry.isEmpty()
                 || this_foundry == other_foundry)
index 4ae31c3..ebc842c 100644 (file)
@@ -113,7 +113,7 @@ struct QFontDef
                     && styleStrategy == other.styleStrategy
                     && ignorePitch == other.ignorePitch && fixedPitch == other.fixedPitch
                     && family == other.family
-                    && styleName == other.styleName
+                    && (styleName.isEmpty() || other.styleName.isEmpty() || styleName == other.styleName)
                     && hintingPreference == other.hintingPreference
 #ifdef Q_WS_X11
                     && addStyle == other.addStyle