From d67da1e7216a1b1281f418ecaa067cd3014e47c0 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 16 Apr 2014 17:44:56 +0200 Subject: Remove FontNameHash, use standard OUStringHash Change-Id: If123bbe8a4ee044ef45f418be0118ccf9509f4e7 --- vcl/inc/PhysicalFontCollection.hxx | 2 +- vcl/source/outdev/font.cxx | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/PhysicalFontCollection.hxx b/vcl/inc/PhysicalFontCollection.hxx index 9c0c7a19ada2..fd9eb157ae51 100644 --- a/vcl/inc/PhysicalFontCollection.hxx +++ b/vcl/inc/PhysicalFontCollection.hxx @@ -35,7 +35,7 @@ private: mutable bool mbMatchData; // true if matching attributes are initialized bool mbMapNames; // true if MapNames are available - typedef boost::unordered_map PhysicalFontFamilies; + typedef boost::unordered_map PhysicalFontFamilies; PhysicalFontFamilies maPhysicalFontFamilies; ImplPreMatchFontSubstitution* mpPreMatchHook; // device specific prematch substitution diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index c1565f743b14..c82badd18ec5 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -770,16 +770,19 @@ size_t ImplFontCache::IFSD_Hash::operator()( const FontSelectPattern& rFSD ) con size_t FontSelectPatternAttributes::hashCode() const { // TODO: does it pay off to improve this hash function? - static FontNameHash aFontNameHash; - size_t nHash = aFontNameHash( maSearchName ); + size_t nHash; #if ENABLE_GRAPHITE // check for features and generate a unique hash if necessary if (maTargetName.indexOf(grutils::GrFeatureParser::FEAT_PREFIX) != -1) { - nHash = aFontNameHash( maTargetName ); + nHash = maTargetName.hashCode(); } + else #endif + { + nHash = maSearchName.hashCode(); + } nHash += 11 * mnHeight; nHash += 19 * GetWeight(); nHash += 29 * GetSlant(); -- cgit