Reviewed by Eric.
authorggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Aug 2006 19:16:12 +0000 (19:16 +0000)
committerggaren <ggaren@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 29 Aug 2006 19:16:12 +0000 (19:16 +0000)
        Implementing font hashing properly, fixes weird crashes in HashMap.

        * platform/qt/FontPlatformData.h:
        * platform/qt/FontPlatformDataQt.cpp:
        (WebCore::FontPlatformData::FontPlatformData):
        (WebCore::FontPlatformData::hash):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16096 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/qt/FontPlatformData.h
WebCore/platform/qt/FontPlatformDataQt.cpp

index b67055ea035c81a724bdb5b691abde9296ef7ef7..7fd2508c5d7db16148ad6eb51fc5b7d6ad1a82b2 100644 (file)
@@ -1,3 +1,14 @@
+2006-08-29  Nikolas Zimmermann  <zimmermann@kde.org>
+
+        Reviewed by Eric.
+
+        Implementing font hashing properly, fixes weird crashes in HashMap.
+
+        * platform/qt/FontPlatformData.h:
+        * platform/qt/FontPlatformDataQt.cpp:
+        (WebCore::FontPlatformData::FontPlatformData):
+        (WebCore::FontPlatformData::hash):
+
 2006-08-29  Nikolas Zimmermann  <zimmermann@kde.org>
 
         Reviewed by ggaren.
index 3f8362559ee316ae4c4427bebdfb9598c8d282ee..557e375f7693b2f0584b93bbd508e5e203f9443f 100644 (file)
@@ -57,7 +57,6 @@ public:
 
 private:
     QFont* m_font;
-    FontDescription m_fontDescription;
 };
 
 }
index 3d767664825d57644b13961d688ac7018f5c4c7e..ca1a71d3716f62a7de6231010019c33b94406c7f 100644 (file)
@@ -34,6 +34,7 @@
 #include "DeprecatedString.h"
 #include "FontDescription.h"
 
+#include <QHash>
 #include <QFontInfo>
 
 namespace WebCore {
@@ -50,7 +51,6 @@ FontPlatformData::FontPlatformData(Deleted)
 
 FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const AtomicString& familyName)
     : m_font(new QFont("Times New Roman", 12))
-    , m_fontDescription(fontDescription)
 {
     m_font->setFamily(familyName.domString());
     m_font->setPixelSize(fontDescription.computedSize());
@@ -82,7 +82,7 @@ QFont* FontPlatformData::fontPtr() const
 
 unsigned FontPlatformData::hash() const
 {
-    return StringImpl::computeHash((UChar*) &m_fontDescription, sizeof(FontDescription) / sizeof(UChar));
+    return qHash(m_font);
 }
 
 bool FontPlatformData::operator==(const FontPlatformData& other) const