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

Caolán McNamara caolan at kemper.freedesktop.org
Thu Dec 30 13:03:00 PST 2010


 l10ntools/inc/export.hxx     |    3 +--
 l10ntools/source/export2.cxx |    3 ++-
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit b416ffd411b4eada02af80f422e38ebf5f1c840c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 30 20:51:41 2010 +0000

    osl_getProcessInfo requires Size to be set first

diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx
index d35a357..ae80731 100644
--- a/l10ntools/source/export2.cxx
+++ b/l10ntools/source/export2.cxx
@@ -678,7 +678,8 @@ void Export::getRandomName( const ByteString& sPrefix , ByteString& sRandStr , c
     int					i;
 
     osl_getSystemTime( &tv );
-    oslProcessInfo	proInfo;
+    oslProcessInfo proInfo;
+    proInfo.Size = sizeof(oslProcessInfo);
     osl_getProcessInfo( 0 , osl_Process_IDENTIFIER , &proInfo );
     
     value += ((sal_uInt64) ( tv.Nanosec / 1000 ) << 16) ^ ( tv.Nanosec / 1000 ) ^ proInfo.Ident;
commit 28e449856ab1bce58a465d00de89cbc9fdc17b97
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Dec 30 20:49:53 2010 +0000

    that hash isn't guaranteed to do what you want it to do

diff --git a/l10ntools/inc/export.hxx b/l10ntools/inc/export.hxx
index f3ca74b..6e402bc 100644
--- a/l10ntools/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -80,8 +80,7 @@ struct lessByteString{
 
 struct hashByteString{
     size_t operator()( const ByteString& rName ) const{
-                std::hash< const char* > myHash;
-                return myHash( rName.GetBuffer() );
+        return rtl_str_hashCode_WithLength(rName.GetBuffer(), rName.Len() );
     }
 };
 


More information about the Libreoffice-commits mailing list