[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    qt-copy
From:       Dirk Mueller <mueller () kde ! org>
Date:       2003-07-01 15:26:16
[Download RAW message or body]

CVS commit by mueller: 

make font handling work again in Qt 3.2


  M +2 -0      README.qt-copy   1.232
  M +9 -11     src/kernel/qfont.cpp   1.60


--- qt-copy/README.qt-copy  #1.231:1.232
@@ -105,2 +105,4 @@
   relied on (and otherwise caused an endless loop)
 
+- src/kernel/qfont.cpp: fix qfontdef operator== that caused bad bugs
+  in the font cache (and apparently random horrible font size bugs)

--- qt-copy/src/kernel/qfont.cpp  #1.59:1.60
@@ -75,7 +75,6 @@ bool QFontDef::operator==( const QFontDe
       per-member comparisons.
 
-      When comparing point/pixel sizes, we allow for them to be -1.
-      We use strict comparison if and only if the size members are not
-      -1 in this instance and \a other.
+      When comparing point/pixel sizes, either point or pixelsize could be -1.
+      in This case we have to compare the non negative size value.
 
       To compare the family members, we need to parse the font names
@@ -88,11 +87,10 @@ bool QFontDef::operator==( const QFontDe
     QFontDatabase::parseFontName(other.family, other_foundry, other_family);
 
-    return ((pointSize == -1
-             || other.pointSize == -1
-             || pointSize == other.pointSize)
-            && (pixelSize == -1
-                || other.pixelSize == -1
-                || pixelSize == other.pixelSize)
-            && styleHint     == other.styleHint
+    if ((pointSize == -1 || other.pointSize == -1) && pixelSize != other.pixelSize)
+        return FALSE;
+    if ((pixelSize == -1 || other.pixelSize == -1) && pointSize != other.pointSize)
+        return FALSE;
+
+    return ( styleHint     == other.styleHint
             && styleStrategy == other.styleStrategy
             && weight        == other.weight


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic