Kaydet (Commit) f2be92b6 authored tarafından Caolán McNamara's avatar Caolán McNamara

remove OUStringHashCode in favor of OUStringHash

(and as always if you find one, you can be sure there
are 6 others in there when you grep for them)

Change-Id: I9296ddbdda266c7b6d8a0ac0bc13ec5b6340cee7
üst dbf2273e
...@@ -39,15 +39,7 @@ namespace desktop ...@@ -39,15 +39,7 @@ namespace desktop
running office without UI. running office without UI.
*/ */
struct OUStringHashCode class DispatchWatcherHashMap : public ::boost::unordered_map< OUString, sal_Int32, OUStringHash, ::std::equal_to< OUString > >
{
size_t operator()( const OUString& sString ) const
{
return sString.hashCode();
}
};
class DispatchWatcherHashMap : public ::boost::unordered_map< OUString, sal_Int32, OUStringHashCode, ::std::equal_to< OUString > >
{ {
public: public:
inline void free() inline void free()
......
...@@ -60,16 +60,8 @@ struct FormulaArrayStack ...@@ -60,16 +60,8 @@ struct FormulaArrayStack
}; };
struct FORMULA_DLLPUBLIC OUStringHashCode typedef ::boost::unordered_map< OUString, OpCode, OUStringHash, ::std::equal_to< OUString > > OpCodeHashMap;
{ typedef ::boost::unordered_map< OUString, OUString, OUStringHash, ::std::equal_to< OUString > > ExternalHashMap;
size_t operator()( const OUString& rStr ) const
{
return rtl_ustr_hashCode_WithLength( rStr.getStr(), rStr.getLength() );
}
};
typedef ::boost::unordered_map< OUString, OpCode, OUStringHashCode, ::std::equal_to< OUString > > OpCodeHashMap;
typedef ::boost::unordered_map< OUString, OUString, OUStringHashCode, ::std::equal_to< OUString > > ExternalHashMap;
class FORMULA_DLLPUBLIC FormulaCompiler class FORMULA_DLLPUBLIC FormulaCompiler
{ {
......
...@@ -46,15 +46,6 @@ using namespace ::com::sun::star::beans ; ...@@ -46,15 +46,6 @@ using namespace ::com::sun::star::beans ;
#define PROPERTYNAME_CMD OUString("Command") #define PROPERTYNAME_CMD OUString("Command")
// Method to retrieve a hash code from a string. May be we have to change it to decrease collisions in the hash map
struct OUStringHashCode
{
size_t operator()( const OUString& sString ) const
{
return sString.hashCode();
}
};
/*-**************************************************************************************************************** /*-****************************************************************************************************************
@descr support simple command option structures and operations on it @descr support simple command option structures and operations on it
****************************************************************************************************************-*/ ****************************************************************************************************************-*/
...@@ -108,7 +99,7 @@ class SvtCmdOptions ...@@ -108,7 +99,7 @@ class SvtCmdOptions
private: private:
class CommandHashMap : public ::boost::unordered_map< OUString , class CommandHashMap : public ::boost::unordered_map< OUString ,
sal_Int32 , sal_Int32 ,
OUStringHashCode , OUStringHash ,
::std::equal_to< OUString > > ::std::equal_to< OUString > >
{ {
public: public:
......
...@@ -47,17 +47,9 @@ using namespace ::com::sun::star::uno ; ...@@ -47,17 +47,9 @@ using namespace ::com::sun::star::uno ;
#define PROPERTYCOUNT 1 #define PROPERTYCOUNT 1
struct OUStringHashCode
{
size_t operator()( const OUString& sString ) const
{
return sString.hashCode();
}
};
class ExtensionHashMap : public ::boost::unordered_map< OUString, class ExtensionHashMap : public ::boost::unordered_map< OUString,
sal_Int32, sal_Int32,
OUStringHashCode, OUStringHash,
::std::equal_to< OUString > > ::std::equal_to< OUString > >
{ {
public: public:
......
...@@ -46,15 +46,7 @@ static sal_Int32 nRefCount = 0; ...@@ -46,15 +46,7 @@ static sal_Int32 nRefCount = 0;
class SvtOptionsDlgOptions_Impl : public utl::ConfigItem class SvtOptionsDlgOptions_Impl : public utl::ConfigItem
{ {
private: private:
struct OUStringHashCode typedef boost::unordered_map< OUString, sal_Bool, OUStringHash, ::std::equal_to< OUString > > OptionNodeList;
{
size_t operator()( const OUString& sString ) const
{
return sString.hashCode();
}
};
typedef boost::unordered_map< OUString, sal_Bool, OUStringHashCode, ::std::equal_to< OUString > > OptionNodeList;
OUString m_sPathDelimiter; OUString m_sPathDelimiter;
OptionNodeList m_aOptionNodeList; OptionNodeList m_aOptionNodeList;
......
...@@ -67,21 +67,13 @@ using namespace com::sun::star::lang; ...@@ -67,21 +67,13 @@ using namespace com::sun::star::lang;
#define STRPOS_NOTFOUND -1 #define STRPOS_NOTFOUND -1
struct OUStringHashCode
{
size_t operator()( const OUString& sString ) const
{
return sString.hashCode();
}
};
enum VarNameProperty enum VarNameProperty
{ {
VAR_NEEDS_SYSTEM_PATH, VAR_NEEDS_SYSTEM_PATH,
VAR_NEEDS_FILEURL VAR_NEEDS_FILEURL
}; };
class NameToHandleMap : public ::boost::unordered_map< OUString, sal_Int32, OUStringHashCode, ::std::equal_to< OUString > > class NameToHandleMap : public ::boost::unordered_map< OUString, sal_Int32, OUStringHash, ::std::equal_to< OUString > >
{ {
public: public:
inline void free() { NameToHandleMap().swap( *this ); } inline void free() { NameToHandleMap().swap( *this ); }
...@@ -93,7 +85,7 @@ class EnumToHandleMap : public ::boost::unordered_map< sal_Int32, sal_Int32, boo ...@@ -93,7 +85,7 @@ class EnumToHandleMap : public ::boost::unordered_map< sal_Int32, sal_Int32, boo
inline void free() { EnumToHandleMap().swap( *this ); } inline void free() { EnumToHandleMap().swap( *this ); }
}; };
class VarNameToEnumMap : public ::boost::unordered_map< OUString, VarNameProperty, OUStringHashCode, ::std::equal_to< OUString > > class VarNameToEnumMap : public ::boost::unordered_map< OUString, VarNameProperty, OUStringHash, ::std::equal_to< OUString > >
{ {
public: public:
inline void free() { VarNameToEnumMap().swap( *this ); } inline void free() { VarNameToEnumMap().swap( *this ); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment