OSDN Git Service

compare point size member in QFontDef operator methods
authorIvailo Monev <xakepa10@gmail.com>
Mon, 17 Jan 2022 11:44:53 +0000 (13:44 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Mon, 17 Jan 2022 11:44:53 +0000 (13:44 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/gui/text/qfont_p.h

index 2913674..5f5895c 100644 (file)
@@ -75,7 +75,8 @@ struct QFontDef
     bool exactMatch(const QFontDef &other) const;
     bool operator==(const QFontDef &other) const
     {
-        return pixelSize == other.pixelSize
+        return pointSize == other.pointSize
+                    && pixelSize == other.pixelSize
                     && weight == other.weight
                     && style == other.style
                     && stretch == other.stretch
@@ -87,6 +88,7 @@ struct QFontDef
     }
     inline bool operator<(const QFontDef &other) const
     {
+        if (pointSize != other.pointSize) return pointSize < other.pointSize;
         if (pixelSize != other.pixelSize) return pixelSize < other.pixelSize;
         if (weight != other.weight) return weight < other.weight;
         if (style != other.style) return style < other.style;