diff options
author | Daniel Sikeler <d.sikeler94@gmail.com> | 2014-09-12 06:17:03 +0000 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-09-18 13:12:48 +0200 |
commit | 32d6415617b5815bb5d18719f6d2df74becc0997 (patch) | |
tree | 55c7b6d7c068bb6eee60aa0a7add60cc6595513b | |
parent | d311d85a4d501a0bfef20e610169f20de896a167 (diff) |
fdo#83512 Make use of OUStringHash and OStringHash
Change-Id: I33cafe68c798e3d54943ea1790fa4e73f85e525d
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
26 files changed, 56 insertions, 382 deletions
diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx index 96069a09561c..0d2bc0a80cd4 100644 --- a/cppu/source/uno/lbenv.cxx +++ b/cppu/source/uno/lbenv.cxx @@ -47,6 +47,7 @@ using ::rtl::OUString; +using ::rtl::OUStringHash; namespace { @@ -102,17 +103,9 @@ struct FctPtrHash : }; -struct FctOUStringHash : - public ::std::unary_function< const OUString &, ::std::size_t > -{ - ::std::size_t operator () ( const OUString & rKey ) const - { return rKey.hashCode(); } -}; - // mapping from environment name to environment typedef ::boost::unordered_map< - OUString, uno_Environment *, FctOUStringHash, - ::std::equal_to< OUString > > OUString2EnvironmentMap; + OUString, uno_Environment *, OUStringHash > OUString2EnvironmentMap; // mapping from ptr to object entry typedef ::boost::unordered_map< @@ -120,8 +113,7 @@ typedef ::boost::unordered_map< ::std::equal_to< void * > > Ptr2ObjectMap; // mapping from oid to object entry typedef ::boost::unordered_map< - OUString, ObjectEntry *, FctOUStringHash, - ::std::equal_to< OUString > > OId2ObjectMap; + OUString, ObjectEntry *, OUStringHash > OId2ObjectMap; diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx index 7c0d76552efc..48185d231b2e 100644 --- a/cppu/source/uno/lbmap.cxx +++ b/cppu/source/uno/lbmap.cxx @@ -50,6 +50,7 @@ using namespace com::sun::star::uno; using ::rtl::OUString; using ::rtl::OUStringBuffer; using ::rtl::OUStringToOString; +using ::rtl::OUStringHash; using ::rtl::OString; namespace cppu @@ -120,12 +121,6 @@ struct MappingEntry {} }; -struct FctOUStringHash : public std::unary_function< const OUString &, size_t > -{ - size_t operator()( const OUString & rKey ) const - { return (size_t)rKey.hashCode(); } -}; - struct FctPtrHash : public std::unary_function< uno_Mapping *, size_t > { size_t operator()( uno_Mapping * pKey ) const @@ -133,7 +128,7 @@ struct FctPtrHash : public std::unary_function< uno_Mapping *, size_t > }; typedef boost::unordered_map< - OUString, MappingEntry *, FctOUStringHash, equal_to< OUString > > t_OUString2Entry; + OUString, MappingEntry *, OUStringHash > t_OUString2Entry; typedef boost::unordered_map< uno_Mapping *, MappingEntry *, FctPtrHash, equal_to< uno_Mapping * > > t_Mapping2Entry; diff --git a/extensions/source/ole/ole2uno.hxx b/extensions/source/ole/ole2uno.hxx index b6d74d285fdc..37302fc13750 100644 --- a/extensions/source/ole/ole2uno.hxx +++ b/extensions/source/ole/ole2uno.hxx @@ -70,23 +70,6 @@ const VARTYPE getVarType( const Any& val); bool getType( BSTR name, Type & type); void o2u_attachCurrentThread(); -struct equalOUString_Impl -{ - bool operator()(const OUString & s1, const OUString & s2) const - { - return s1 == s2; - } -}; - -struct hashOUString_Impl -{ - size_t operator()(const OUString & rName) const - { - return rName.hashCode(); - } -}; - - class BridgeRuntimeError { public: diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx index e41a3dcd2c00..4288472b9e3d 100644 --- a/filter/source/svg/svgfilter.hxx +++ b/filter/source/svg/svgfilter.hxx @@ -175,11 +175,6 @@ struct HashReferenceXInterface } }; -struct HashOUString -{ - size_t operator()( const OUString& oustr ) const { return static_cast< size_t >( oustr.hashCode() ); } -}; - struct HashUChar { size_t operator()( const sal_Unicode uchar ) const { return static_cast< size_t >( uchar ); } @@ -212,7 +207,7 @@ public: typedef Sequence< Reference< XDrawPage > > XDrawPageSequence; typedef ::boost::unordered_set< sal_Unicode, HashUChar > UCharSet; - typedef ::boost::unordered_map< OUString, UCharSet, HashOUString > UCharSetMap; + typedef ::boost::unordered_map< OUString, UCharSet, OUStringHash > UCharSetMap; typedef ::boost::unordered_map< Reference< XInterface >, UCharSetMap, HashReferenceXInterface > UCharSetMapMap; typedef ::boost::unordered_map< Reference< XInterface >, OUString, HashReferenceXInterface > UOStringMap; diff --git a/filter/source/svg/svgwriter.hxx b/filter/source/svg/svgwriter.hxx index 24511423d9e7..4190937e8470 100644 --- a/filter/source/svg/svgwriter.hxx +++ b/filter/source/svg/svgwriter.hxx @@ -169,22 +169,13 @@ struct BulletListItemInfo }; -// - OUStringHasher - - - -struct OUStringHasher -{ - size_t operator()( const OUString& oustr ) const { return static_cast< size_t >( oustr.hashCode() ); } -}; - - // - SVGTextWriter - class SVGTextWriter { public: - typedef ::boost::unordered_map< OUString, BulletListItemInfo, OUStringHasher > BulletListItemInfoMap; + typedef ::boost::unordered_map< OUString, BulletListItemInfo, OUStringHash > BulletListItemInfoMap; private: SVGExport& mrExport; diff --git a/idlc/inc/idlc/idlctypes.hxx b/idlc/inc/idlc/idlctypes.hxx index 12c73491980e..7766f837b3a5 100644 --- a/idlc/inc/idlc/idlctypes.hxx +++ b/idlc/inc/idlc/idlctypes.hxx @@ -30,22 +30,6 @@ #include <sal/types.h> #include <rtl/ustring.hxx> -struct EqualString -{ - bool operator()(const OString& str1, const OString& str2) const - { - return (str1 == str2); - } -}; - -struct HashString -{ - sal_Int32 operator()(const OString& str) const - { - return str.hashCode(); - } -}; - struct LessString { bool operator()(const OString& str1, const OString& str2) const @@ -60,7 +44,7 @@ typedef ::std::set< OString, LessString > StringSet; class AstDeclaration; -typedef ::boost::unordered_map< OString, AstDeclaration*, HashString, EqualString > DeclMap; +typedef ::boost::unordered_map< OString, AstDeclaration*, OStringHash > DeclMap; typedef ::std::list< AstDeclaration* > DeclList; class AstScope; diff --git a/idlc/inc/idlc/options.hxx b/idlc/inc/idlc/options.hxx index 887f0536d6b9..08d839e736f1 100644 --- a/idlc/inc/idlc/options.hxx +++ b/idlc/inc/idlc/options.hxx @@ -24,8 +24,7 @@ typedef ::boost::unordered_map< OString, OString, - HashString, - EqualString > OptionMap; + OStringHash > OptionMap; class IllegalArgument { diff --git a/include/codemaker/global.hxx b/include/codemaker/global.hxx index 6ee033c7dfd1..b5aabff3099e 100644 --- a/include/codemaker/global.hxx +++ b/include/codemaker/global.hxx @@ -30,22 +30,6 @@ #include <rtl/ustring.hxx> #include <rtl/strbuf.hxx> -struct EqualString -{ - bool operator()(const ::rtl::OString& str1, const ::rtl::OString& str2) const - { - return (str1 == str2); - } -}; - -struct HashString -{ - size_t operator()(const ::rtl::OString& str) const - { - return str.hashCode(); - } -}; - struct LessString { bool operator()(const ::rtl::OString& str1, const ::rtl::OString& str2) const diff --git a/include/codemaker/options.hxx b/include/codemaker/options.hxx index 0c71b7537142..d322a7443022 100644 --- a/include/codemaker/options.hxx +++ b/include/codemaker/options.hxx @@ -28,8 +28,7 @@ typedef ::boost::unordered_map < ::rtl::OString, ::rtl::OString, - HashString, - EqualString + OStringHash > OptionMap; class IllegalArgument diff --git a/include/toolkit/controls/eventcontainer.hxx b/include/toolkit/controls/eventcontainer.hxx index 2744c1d413ce..9ba2391638ce 100644 --- a/include/toolkit/controls/eventcontainer.hxx +++ b/include/toolkit/controls/eventcontainer.hxx @@ -36,28 +36,11 @@ namespace toolkit { // Hashtable to optimize -struct hashName_Impl -{ - size_t operator()(const OUString& Str) const - { - return (size_t)Str.hashCode(); - } -}; - -struct eqName_Impl -{ - bool operator()(const OUString& Str1, const OUString& Str2) const - { - return ( Str1 == Str2 ); - } -}; - typedef boost::unordered_map < OUString, sal_Int32, - hashName_Impl, - eqName_Impl + OUStringHash > NameContainerNameMap; diff --git a/include/xmloff/nmspmap.hxx b/include/xmloff/nmspmap.hxx index 08340cf965ba..70913f893391 100644 --- a/include/xmloff/nmspmap.hxx +++ b/include/xmloff/nmspmap.hxx @@ -50,14 +50,6 @@ public: sal_uInt16 nKey; }; -struct OUStringEqFunc -{ - bool operator()( const OUString &r1, const OUString &r2) const - { - return r1 == r2; - } -}; - struct uInt32lt { bool operator()( const sal_uInt32 &r1, const sal_uInt32 &r2) const @@ -76,7 +68,7 @@ struct QNamePairHash }; typedef ::boost::unordered_map < QNamePair, OUString, QNamePairHash > QNameCache; -typedef ::boost::unordered_map < OUString, ::rtl::Reference <NameSpaceEntry >, OUStringHash, OUStringEqFunc > NameSpaceHash; +typedef ::boost::unordered_map < OUString, ::rtl::Reference <NameSpaceEntry >, OUStringHash > NameSpaceHash; typedef ::std::map < sal_uInt16, ::rtl::Reference < NameSpaceEntry >, uInt32lt > NameSpaceMap; class XMLOFF_DLLPUBLIC SvXMLNamespaceMap diff --git a/scripting/source/stringresource/stringresource.hxx b/scripting/source/stringresource/stringresource.hxx index 5be7acd0f66c..adb4710d2dfe 100644 --- a/scripting/source/stringresource/stringresource.hxx +++ b/scripting/source/stringresource/stringresource.hxx @@ -53,28 +53,11 @@ namespace stringresource // Hashtable to map string ids to string -struct hashName_Impl -{ - size_t operator()(const OUString& Str) const - { - return (size_t)Str.hashCode(); - } -}; - -struct eqName_Impl -{ - bool operator()(const OUString& Str1, const OUString& Str2) const - { - return ( Str1 == Str2 ); - } -}; - typedef boost::unordered_map < OUString, OUString, - hashName_Impl, - eqName_Impl + OUStringHash > IdToStringMap; @@ -82,8 +65,7 @@ typedef boost::unordered_map < OUString, sal_Int32, - hashName_Impl, - eqName_Impl + OUStringHash > IdToIndexMap; diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 188ef595d6ec..8210a3a82bbb 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -553,24 +553,7 @@ IndexTabPage_Impl::~IndexTabPage_Impl() namespace sfx2 { - struct equalOUString - { - bool operator()( const OUString& rKey1, const OUString& rKey2 ) const - { - return !!( rKey1 == rKey2 ); - } - }; - - - struct hashOUString - { - size_t operator()( const OUString& rName ) const - { - return rName.hashCode(); - } - }; - - typedef ::boost::unordered_map< OUString, int, hashOUString, equalOUString > KeywordInfo; + typedef ::boost::unordered_map< OUString, int, OUStringHash > KeywordInfo; } #define NEW_ENTRY( url, bool ) \ diff --git a/stoc/source/corereflection/base.hxx b/stoc/source/corereflection/base.hxx index 909b182ead58..f49eb74bf6a5 100644 --- a/stoc/source/corereflection/base.hxx +++ b/stoc/source/corereflection/base.hxx @@ -78,9 +78,9 @@ inline typelib_TypeDescription * getTypeByName( const OUString & rName ) } typedef boost::unordered_map< OUString, css::uno::WeakReference< css::reflection::XIdlField >, - FctHashOUString, std::equal_to< OUString > > OUString2Field; + OUStringHash > OUString2Field; typedef boost::unordered_map< OUString, css::uno::WeakReference< css::reflection::XIdlMethod >, - FctHashOUString, std::equal_to< OUString > > OUString2Method; + OUStringHash > OUString2Method; class IdlReflectionServiceImpl diff --git a/stoc/source/corereflection/lrucache.hxx b/stoc/source/corereflection/lrucache.hxx index 740991d9e827..67f351b21033 100644 --- a/stoc/source/corereflection/lrucache.hxx +++ b/stoc/source/corereflection/lrucache.hxx @@ -32,7 +32,7 @@ <br> @author Daniel Boelzle */ -template< class t_Key, class t_Val, class t_KeyHash, class t_KeyEqual > +template< class t_Key, class t_Val, class t_KeyHash > class LRU_Cache { struct CacheEntry @@ -42,7 +42,7 @@ class LRU_Cache CacheEntry * pPred; CacheEntry * pSucc; }; - typedef ::boost::unordered_map< t_Key, CacheEntry *, t_KeyHash, t_KeyEqual > t_Key2Element; + typedef ::boost::unordered_map< t_Key, CacheEntry *, t_KeyHash > t_Key2Element; mutable ::osl::Mutex _aCacheMutex; sal_Int32 _nCachedElements; @@ -89,8 +89,8 @@ public: inline void clear(); }; -template< class t_Key, class t_Val, class t_KeyHash, class t_KeyEqual > -inline LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::LRU_Cache( sal_Int32 nCachedElements ) +template< class t_Key, class t_Val, class t_KeyHash > +inline LRU_Cache< t_Key, t_Val, t_KeyHash >::LRU_Cache( sal_Int32 nCachedElements ) #ifdef __CACHE_DIAGNOSE : _nCachedElements( 4 ) #else @@ -113,14 +113,14 @@ inline LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::LRU_Cache( sal_Int32 nC } } -template< class t_Key, class t_Val, class t_KeyHash, class t_KeyEqual > -inline LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::~LRU_Cache() +template< class t_Key, class t_Val, class t_KeyHash > +inline LRU_Cache< t_Key, t_Val, t_KeyHash >::~LRU_Cache() { delete [] _pBlock; } -template< class t_Key, class t_Val, class t_KeyHash, class t_KeyEqual > -inline void LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::toFront( CacheEntry * pEntry ) const +template< class t_Key, class t_Val, class t_KeyHash > +inline void LRU_Cache< t_Key, t_Val, t_KeyHash >::toFront( CacheEntry * pEntry ) const { if (pEntry != _pHead) { @@ -141,16 +141,16 @@ inline void LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::toFront( CacheEntr } } -template< class t_Key, class t_Val, class t_KeyHash, class t_KeyEqual > -inline bool LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::hasValue( const t_Key & rKey ) const +template< class t_Key, class t_Val, class t_KeyHash > +inline bool LRU_Cache< t_Key, t_Val, t_KeyHash >::hasValue( const t_Key & rKey ) const { ::osl::MutexGuard aGuard( _aCacheMutex ); const typename t_Key2Element::const_iterator iFind( _aKey2Element.find( rKey ) ); return (iFind != _aKey2Element.end()); } -template< class t_Key, class t_Val, class t_KeyHash, class t_KeyEqual > -inline t_Val LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::getValue( const t_Key & rKey ) const +template< class t_Key, class t_Val, class t_KeyHash > +inline t_Val LRU_Cache< t_Key, t_Val, t_KeyHash >::getValue( const t_Key & rKey ) const { ::osl::MutexGuard aGuard( _aCacheMutex ); const typename t_Key2Element::const_iterator iFind( _aKey2Element.find( rKey ) ); @@ -168,8 +168,8 @@ inline t_Val LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::getValue( const t return t_Val(); } -template< class t_Key, class t_Val, class t_KeyHash, class t_KeyEqual > -inline void LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::setValue( +template< class t_Key, class t_Val, class t_KeyHash > +inline void LRU_Cache< t_Key, t_Val, t_KeyHash >::setValue( const t_Key & rKey, const t_Val & rValue ) { ::osl::MutexGuard aGuard( _aCacheMutex ); @@ -206,8 +206,8 @@ inline void LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::setValue( } } -template< class t_Key, class t_Val, class t_KeyHash, class t_KeyEqual > -inline void LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::clear() +template< class t_Key, class t_Val, class t_KeyHash > +inline void LRU_Cache< t_Key, t_Val, t_KeyHash >::clear() { ::osl::MutexGuard aGuard( _aCacheMutex ); _aKey2Element.clear(); @@ -223,16 +223,9 @@ inline void LRU_Cache< t_Key, t_Val, t_KeyHash, t_KeyEqual >::clear() } -struct FctHashOUString : public ::std::unary_function< const OUString &, size_t > -{ - size_t operator()( const OUString & rKey ) const - { return rKey.hashCode(); } -}; - /** Template instance for OUString keys, Any values.<br> */ -typedef LRU_Cache< OUString, css::uno::Any, - FctHashOUString, ::std::equal_to< OUString > > +typedef LRU_Cache< OUString, css::uno::Any, OUStringHash > LRU_CacheAnyByOUString; diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index 482cb3fd3ca7..2051b08124f8 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -136,28 +136,11 @@ bool isDerivedFrom( Reference<XIdlClass> xToTestClass, Reference<XIdlClass> xDer // part of the new Instance-related ImplIntrospectionAccess // Hashtable for the search of names -struct hashName_Impl -{ - size_t operator()(const OUString& Str) const - { - return (size_t)Str.hashCode(); - } -}; - -struct eqName_Impl -{ - bool operator()(const OUString& Str1, const OUString& Str2) const - { - return ( Str1 == Str2 ); - } -}; - typedef boost::unordered_map < OUString, sal_Int32, - hashName_Impl, - eqName_Impl + OUStringHash > IntrospectionNameMap; @@ -168,8 +151,7 @@ typedef boost::unordered_map < OUString, OUString, - hashName_Impl, - eqName_Impl + OUStringHash > LowerToExactNameMap; diff --git a/stoc/source/namingservice/namingservice.cxx b/stoc/source/namingservice/namingservice.cxx index 171ee9b54ddc..b0b016a87c03 100644 --- a/stoc/source/namingservice/namingservice.cxx +++ b/stoc/source/namingservice/namingservice.cxx @@ -61,24 +61,11 @@ static OUString ns_getImplementationName() return OUString(IMPLNAME); } -struct equalOWString_Impl -{ - bool operator()(const OUString & s1, const OUString & s2) const - { return s1 == s2; } -}; - -struct hashOWString_Impl -{ - size_t operator()(const OUString & rName) const - { return rName.hashCode(); } -}; - typedef boost::unordered_map < OUString, Reference<XInterface >, - hashOWString_Impl, - equalOWString_Impl + OUStringHash > HashMap_OWString_Interface; diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx index d338fa45d303..45d64e13a20b 100644 --- a/stoc/source/servicemanager/servicemanager.cxx +++ b/stoc/source/servicemanager/servicemanager.cxx @@ -290,39 +290,24 @@ Any ImplementationEnumeration_Impl::nextElement() /***************************************************************************** Hash tables *****************************************************************************/ -struct equalOWString_Impl -{ - bool operator()(const OUString & s1, const OUString & s2) const - { return s1 == s2; } -}; - -struct hashOWString_Impl -{ - size_t operator()(const OUString & rName) const - { return rName.hashCode(); } -}; - typedef boost::unordered_set < OUString, - hashOWString_Impl, - equalOWString_Impl + OUStringHash > HashSet_OWString; typedef boost::unordered_multimap < OUString, Reference<XInterface >, - hashOWString_Impl, - equalOWString_Impl + OUStringHash > HashMultimap_OWString_Interface; typedef boost::unordered_map < OUString, Reference<XInterface >, - hashOWString_Impl, - equalOWString_Impl + OUStringHash > HashMap_OWString_Interface; /***************************************************************************** diff --git a/ucb/source/ucp/hierarchy/hierarchyprovider.hxx b/ucb/source/ucp/hierarchy/hierarchyprovider.hxx index 4f176f820e0c..7910309d42fd 100644 --- a/ucb/source/ucp/hierarchy/hierarchyprovider.hxx +++ b/ucb/source/ucp/hierarchy/hierarchyprovider.hxx @@ -63,29 +63,11 @@ struct ConfigProviderMapEntry ConfigProviderMapEntry() : bTriedToGetRootReadAccess( false ) {} }; -struct equalString -{ - bool operator()( - const OUString& rKey1, const OUString& rKey2 ) const - { - return !!( rKey1 == rKey2 ); - } -}; - -struct hashString -{ - size_t operator()( const OUString & rName ) const - { - return rName.hashCode(); - } -}; - typedef boost::unordered_map < OUString, // servcie specifier ConfigProviderMapEntry, - hashString, - equalString + OUStringHash > ConfigProviderMap; diff --git a/ucb/source/ucp/package/pkgprovider.cxx b/ucb/source/ucp/package/pkgprovider.cxx index 42ee7e789be6..cf3c35472c91 100644 --- a/ucb/source/ucp/package/pkgprovider.cxx +++ b/ucb/source/ucp/package/pkgprovider.cxx @@ -91,29 +91,11 @@ public: -struct equalString -{ - bool operator()( - const OUString& rKey1, const OUString& rKey2 ) const - { - return !!( rKey1 == rKey2 ); - } -}; - -struct hashString -{ - size_t operator()( const OUString & rName ) const - { - return rName.hashCode(); - } -}; - typedef boost::unordered_map < OUString, Package*, - hashString, - equalString + OUStringHash > PackageMap; diff --git a/ucb/source/ucp/webdav-neon/ContentProperties.hxx b/ucb/source/ucp/webdav-neon/ContentProperties.hxx index 73c228c7854a..07feceeae0ef 100644 --- a/ucb/source/ucp/webdav-neon/ContentProperties.hxx +++ b/ucb/source/ucp/webdav-neon/ContentProperties.hxx @@ -48,22 +48,6 @@ struct DAVResource; -struct equalString -{ - bool operator()( const OUString& s1, const OUString& s2 ) const - { - return !!( s1 == s2 ); - } -}; - -struct hashString -{ - size_t operator()( const OUString & rName ) const - { - return rName.hashCode(); - } -}; - // PropertyValueMap. @@ -94,8 +78,7 @@ typedef boost::unordered_map < OUString, PropertyValue, - hashString, - equalString + OUStringHash > PropertyValueMap; diff --git a/ucb/source/ucp/webdav/ContentProperties.hxx b/ucb/source/ucp/webdav/ContentProperties.hxx index 0fa730468114..64e227f9fe18 100644 --- a/ucb/source/ucp/webdav/ContentProperties.hxx +++ b/ucb/source/ucp/webdav/ContentProperties.hxx @@ -41,22 +41,6 @@ struct DAVResource; -struct equalString -{ - bool operator()( const OUString& s1, const OUString& s2 ) const - { - return !!( s1 == s2 ); - } -}; - -struct hashString -{ - size_t operator()( const OUString & rName ) const - { - return rName.hashCode(); - } -}; - // PropertyValueMap. @@ -87,8 +71,7 @@ typedef boost::unordered_map < OUString, PropertyValue, - hashString, - equalString + OUStringHash > PropertyValueMap; diff --git a/ucbhelper/source/provider/providerhelper.cxx b/ucbhelper/source/provider/providerhelper.cxx index 21dcd08d1bb5..c7fa7caba7d1 100644 --- a/ucbhelper/source/provider/providerhelper.cxx +++ b/ucbhelper/source/provider/providerhelper.cxx @@ -38,29 +38,11 @@ using namespace com::sun::star; namespace ucbhelper_impl { -struct equalString -{ - bool operator()( - const OUString& rKey11, const OUString& rKey22 ) const - { - return !!( rKey11 == rKey22 ); - } -}; - -struct hashString -{ - size_t operator()( const OUString & rName ) const - { - return rName.hashCode(); - } -}; - typedef boost::unordered_map < OUString, uno::WeakReference< ucb::XContent >, - hashString, - equalString + OUStringHash > Contents; diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx index 366a914cbc6d..3e798cf1cc5b 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.hxx +++ b/xmlhelp/source/cxxhelp/provider/databases.hxx @@ -142,22 +142,6 @@ namespace chelp { { public: - struct eq - { - bool operator()( const OUString& rKey1, const OUString& rKey2 ) const - { - return (rKey1 == rKey2); - } - }; - - struct ha - { - size_t operator()( const OUString& rName ) const - { - return rName.hashCode(); - } - }; - /** * Input is the installdirectory in system dependent notation */ @@ -295,55 +279,37 @@ namespace chelp { std::vector< OUString > m_avModules; - typedef boost::unordered_map< OUString,helpdatafileproxy::Hdf*,ha,eq > DatabasesTable; + typedef boost::unordered_map< OUString,helpdatafileproxy::Hdf*,OUStringHash > DatabasesTable; DatabasesTable m_aDatabases; // Language and module dependent databases - typedef boost::unordered_map< OUString,OUString,ha,eq > LangSetTable; + typedef boost::unordered_map< OUString,OUString,OUStringHash > LangSetTable; LangSetTable m_aLangSet; // Mapping to of lang-country to lang - typedef boost::unordered_map< OUString,StaticModuleInformation*,ha,eq > ModInfoTable; + typedef boost::unordered_map< OUString,StaticModuleInformation*,OUStringHash > ModInfoTable; ModInfoTable m_aModInfo; // Module information - typedef boost::unordered_map< OUString,KeywordInfo*,ha,eq > KeywordInfoTable; + typedef boost::unordered_map< OUString,KeywordInfo*,OUStringHash > KeywordInfoTable; KeywordInfoTable m_aKeywordInfo; // Module information typedef boost::unordered_map< OUString, ::com::sun::star::uno::Reference< com::sun::star::container::XHierarchicalNameAccess >, - ha, - eq > ZipFileTable; + OUStringHash > ZipFileTable; ZipFileTable m_aZipFileTable; // No closing of an once opened jarfile typedef boost::unordered_map< OUString, ::com::sun::star::uno::Reference< com::sun::star::i18n::XCollator >, - ha, - eq > CollatorTable; + OUStringHash > CollatorTable; CollatorTable m_aCollatorTable; - struct ostring_eq - { - bool operator()( const OString& rKey1, const OString& rKey2 ) const - { - return (rKey1 == rKey2); - } - }; - - struct ostring_ha - { - size_t operator()( const OString& rName ) const - { - return rName.hashCode(); - } - }; typedef boost::unordered_set< OString, - ostring_ha, - ostring_eq > EmptyActiveTextSet; + OStringHash > EmptyActiveTextSet; EmptyActiveTextSet m_aEmptyActiveTextSet; // methods @@ -367,8 +333,7 @@ namespace chelp { < OUString, bool, - Databases::ha, - Databases::eq + OUStringHash > ExtensionHelpExistanceMap; diff --git a/xmlhelp/source/cxxhelp/provider/db.hxx b/xmlhelp/source/cxxhelp/provider/db.hxx index 5d5823c00dea..5b363cfe1596 100644 --- a/xmlhelp/source/cxxhelp/provider/db.hxx +++ b/xmlhelp/source/cxxhelp/provider/db.hxx @@ -62,20 +62,8 @@ namespace helpdatafileproxy { { return m_pBuffer; } }; - struct eq - { - bool operator()( const OString& rKey1, const OString& rKey2 ) const - { return (rKey1 == rKey2); } - }; - - struct ha - { - size_t operator()( const OString& rName ) const - { return rName.hashCode(); } - }; - - typedef boost::unordered_map< OString,std::pair<int,int>,ha,eq > StringToValPosMap; - typedef boost::unordered_map< OString,OString,ha,eq > StringToDataMap; + typedef boost::unordered_map< OString,std::pair<int,int>,OStringHash > StringToValPosMap; + typedef boost::unordered_map< OString,OString,OStringHash > StringToDataMap; class Hdf : hdf_internal::Noncopyable { diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index c3938c0de476..b6b0db95bfcf 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -1254,7 +1254,7 @@ void SdXMLCustomShapePropertyMerge( std::vector< com::sun::star::beans::Property } } -typedef boost::unordered_map< OUString, sal_Int32, OUStringHash, OUStringEqFunc> EquationHashMap; +typedef boost::unordered_map< OUString, sal_Int32, OUStringHash > EquationHashMap; /* if rPara.Type is from type EnhancedCustomShapeParameterType::EQUATION, the name of the equation will be converted from OUString to index */ |