[Libreoffice-commits] .: 2 commits - l10ntools/inc vcl/source

Caolán McNamara caolan at kemper.freedesktop.org
Fri Feb 11 04:57:55 PST 2011


 l10ntools/inc/tagtest.hxx        |    5 +----
 vcl/source/glyphs/gcach_ftyp.cxx |    3 ++-
 2 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit e854a7889067a298922d44b423148b1ba556151b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Feb 11 12:50:02 2011 +0000

    (std|boost)::hash on a const char* hashes the pointer not the contents

diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx
index d5e3b82..544224d 100644
--- a/vcl/source/glyphs/gcach_ftyp.cxx
+++ b/vcl/source/glyphs/gcach_ftyp.cxx
@@ -138,7 +138,8 @@ FT_Error (*pFTOblique)(FT_GlyphSlot);
 static bool bEnableSizeFT = false;
 
 struct EqStr{ bool operator()(const char* a, const char* b) const { return !strcmp(a,b); } };
-typedef ::boost::unordered_map<const char*,FtFontFile*,::boost::hash<const char*>, EqStr> FontFileList;
+struct HashStr { size_t operator()( const char* s ) const { return rtl_str_hashCode(s); } };
+typedef ::boost::unordered_map<const char*,FtFontFile*,HashStr, EqStr> FontFileList;
 namespace { struct vclFontFileList : public rtl::Static< FontFileList, vclFontFileList > {}; }
 
 // -----------------------------------------------------------------------
commit 2756c9435e5af07a9a1ce93b4bbb76f552bb765d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Feb 11 12:44:51 2011 +0000

    (std|boost)::hash on a const char* hashes the pointer not the contents

diff --git a/l10ntools/inc/tagtest.hxx b/l10ntools/inc/tagtest.hxx
index 2812486..ae4f916 100644
--- a/l10ntools/inc/tagtest.hxx
+++ b/l10ntools/inc/tagtest.hxx
@@ -58,13 +58,10 @@ struct lessByteString{
 
 struct hashByteString{
     size_t operator()( const ByteString& rName ) const{
-                boost::hash< const char* > myHash;
-                return myHash( rName.GetBuffer() );
+                return rtl_str_hashCode(rName.GetBuffer());
     }
 };
 
-
-
 typedef boost::unordered_map<ByteString , String , hashByteString,equalByteString>
                                 StringHashMap;
 


More information about the Libreoffice-commits mailing list