Kaydet (Commit) 87a9979c authored tarafından Noel Grandin's avatar Noel Grandin

overload std::hash for OUString and OString

no need to explicitly specify it anymore

Change-Id: I6ad9259cce77201fdd75152533f5151aae83e9ec
Reviewed-on: https://gerrit.libreoffice.org/43567Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst d76c4e5c
......@@ -320,8 +320,7 @@ private:
typedef std::unordered_map< OUString,
css::beans::PropertyValue,
OUStringHash > tPropValMap;
css::beans::PropertyValue > tPropValMap;
class Document: public ::VCLXAccessibleComponent, public ::SfxListener
{
......
......@@ -1138,8 +1138,7 @@ struct ClassModuleRunInitItem
// Derive from unordered_map type instead of typedef
// to allow forward declaration in sbmod.hxx
class ModuleInitDependencyMap : public
std::unordered_map< OUString, ClassModuleRunInitItem,
OUStringHash >
std::unordered_map< OUString, ClassModuleRunInitItem >
{};
void SbModule::implProcessModuleRunInit( ModuleInitDependencyMap& rMap, ClassModuleRunInitItem& rItem )
......
......@@ -3205,7 +3205,7 @@ Reference< XTypeDescriptionEnumeration > getTypeDescriptorEnumeration( const OUS
return xEnum;
}
typedef std::unordered_map< OUString, Any, OUStringHash > VBAConstantsHash;
typedef std::unordered_map< OUString, Any > VBAConstantsHash;
VBAConstantHelper&
VBAConstantHelper::instance()
......
......@@ -69,7 +69,7 @@ typedef ::cppu::WeakImplHelper<
class NameContainer : public ::cppu::BaseMutex, public NameContainer_BASE
{
typedef std::unordered_map < OUString, sal_Int32, OUStringHash > NameContainerNameMap;
typedef std::unordered_map < OUString, sal_Int32 > NameContainerNameMap;
NameContainerNameMap mHashMap;
std::vector< OUString > mNames;
......
......@@ -364,7 +364,7 @@ public:
virtual void Clear() override;
};
typedef std::unordered_map< OUString, css::uno::Any, OUStringHash > VBAConstantsHash;
typedef std::unordered_map< OUString, css::uno::Any > VBAConstantsHash;
typedef std::vector< OUString > VBAConstantsVector;
......
......@@ -103,7 +103,7 @@ public:
};
typedef std::unordered_map< OUString, css::script::ModuleInfo, OUStringHash > ModuleInfoMap;
typedef std::unordered_map< OUString, css::script::ModuleInfo > ModuleInfoMap;
typedef ::cppu::ImplHelper1< css::script::vba::XVBAModuleInfo > SfxScriptLibrary_BASE;
......@@ -111,7 +111,7 @@ class SfxScriptLibrary : public SfxLibrary, public SfxScriptLibrary_BASE
{
friend class SfxScriptLibraryContainer;
typedef std::unordered_map< OUString, css::script::ModuleInfo, OUStringHash > ModuleInfoMap;
typedef std::unordered_map< OUString, css::script::ModuleInfo > ModuleInfoMap;
bool mbLoadedSource;
bool mbLoadedBinary;
......
......@@ -207,7 +207,7 @@ private:
static void flushCode(
unsigned char const * begin, unsigned char const * end);
typedef std::unordered_map< OUString, Vtables, OUStringHash > Map;
typedef std::unordered_map< OUString, Vtables > Map;
osl::Mutex m_mutex;
Map m_map;
......
......@@ -88,7 +88,7 @@ static OUString toUNOname( char const * p )
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -143,7 +143,7 @@ static OUString toUNOname( char const * p )
class RTTI
{
typedef std::unordered_map< OUString, std::type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, std::type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -81,7 +81,7 @@ public:
std::type_info * getRtti(typelib_TypeDescription const & type);
private:
typedef std::unordered_map<OUString, std::type_info *, OUStringHash> Map;
typedef std::unordered_map<OUString, std::type_info *> Map;
void * app_;
......
......@@ -85,7 +85,7 @@ static OUString toUNOname( char const * p )
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -87,7 +87,7 @@ namespace CPPU_CURRENT_NAMESPACE
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -87,7 +87,7 @@ namespace CPPU_CURRENT_NAMESPACE
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -85,7 +85,7 @@ static OUString toUNOname( char const * p )
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -84,7 +84,7 @@ static OUString toUNOname( char const * p )
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -87,7 +87,7 @@ namespace CPPU_CURRENT_NAMESPACE
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -84,7 +84,7 @@ static OUString toUNOname( char const * p )
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -85,7 +85,7 @@ static OUString toUNOname( char const * p )
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -85,7 +85,7 @@ static OUString toUNOname( char const * p )
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -85,7 +85,7 @@ static OUString toUNOname( char const * p )
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -85,7 +85,7 @@ static OUString toUNOname( char const * p )
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -85,7 +85,7 @@ static OUString toUNOname( char const * p )
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -85,7 +85,7 @@ static OUString toUNOname( char const * p )
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -85,7 +85,7 @@ static OUString toUNOname( char const * p )
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -41,7 +41,7 @@ namespace {
class RTTI
{
typedef std::unordered_map< OUString, std::type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, std::type_info * > t_rtti_map;
osl::Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -143,7 +143,7 @@ static OUString toUNOname( char const * p )
class RTTI
{
typedef std::unordered_map< OUString, std::type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, std::type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -87,7 +87,7 @@ static OUString toUNOname( char const * p )
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -84,7 +84,7 @@ static OUString toUNOname( char const * p )
class RTTI
{
typedef std::unordered_map< OUString, type_info *, OUStringHash > t_rtti_map;
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
Mutex m_mutex;
t_rtti_map m_rttis;
......
......@@ -83,7 +83,7 @@ static inline OUString toRTTIname( OUString const & rUNOname ) throw ()
//#### RTTI simulation #############################################################################
typedef std::unordered_map< OUString, void *, OUStringHash > t_string2PtrMap;
typedef std::unordered_map< OUString, void * > t_string2PtrMap;
class RTTInfos
{
......
......@@ -306,7 +306,7 @@ static inline OUString toRTTIname(
//RTTI simulation
typedef std::unordered_map< OUString, void *, OUStringHash > t_string2PtrMap;
typedef std::unordered_map< OUString, void * > t_string2PtrMap;
class type_info_descriptor;
class RTTInfos
......
......@@ -155,7 +155,7 @@ private:
sal_Int32 calculate(
typelib_InterfaceTypeDescription * type, sal_Int32 offset);
std::unordered_map< OUString, sal_Int32, OUStringHash > m_map;
std::unordered_map< OUString, sal_Int32 > m_map;
};
sal_Int32 VtableFactory::BaseOffset::calculate(
......
......@@ -119,7 +119,7 @@ struct JNI_type_info_holder
};
typedef std::unordered_map<
OUString, JNI_type_info_holder, OUStringHash > t_str2type;
OUString, JNI_type_info_holder > t_str2type;
class JNI_info
{
......
......@@ -54,7 +54,7 @@ using namespace ::com::sun::star;
namespace comphelper {
typedef std::unordered_map<OUString, uno::Reference <embed::XEmbeddedObject>, OUStringHash>
typedef std::unordered_map<OUString, uno::Reference <embed::XEmbeddedObject>>
EmbeddedObjectContainerNameMap;
struct EmbedImpl
......
......@@ -45,7 +45,7 @@ namespace comphelper
using ::com::sun::star::lang::IllegalArgumentException;
using ::com::sun::star::beans::PropertyState_DIRECT_VALUE;
typedef std::unordered_map< OUString, Any, OUStringHash > NamedValueRepository;
typedef std::unordered_map< OUString, Any > NamedValueRepository;
struct NamedValueCollection_Impl
{
......
......@@ -75,7 +75,7 @@ OPropertyArrayAggregationHelper::OPropertyArrayAggregationHelper(
// fill aDelegatorProps with names from _rProperties for a fast existence check
// different kinds of properties are processed differently
std::unordered_set< OUString, OUStringHash > aDelegatorProps;
std::unordered_set< OUString > aDelegatorProps;
aDelegatorProps.reserve( _rProperties.getLength() );
for( auto &delegateProp: _rProperties )
{
......
......@@ -49,7 +49,7 @@ namespace connectivity
{
}
};
typedef std::unordered_map< OUString, AliasEntry, OUStringHash > AliasMap;
typedef std::unordered_map< OUString, AliasEntry > AliasMap;
private:
AliasMap m_aAliasMap;
......
......@@ -146,7 +146,7 @@ namespace connectivity
class MQueryHelperResultEntry
{
private:
typedef std::unordered_map< OString, OUString, OStringHash > FieldMap;
typedef std::unordered_map< OString, OUString > FieldMap;
FieldMap m_Fields;
......
......@@ -91,8 +91,7 @@ typedef std::vector< ColumnMetaData > ColumnMetaDataVector;
typedef std::unordered_map
<
OUString,
sal_Int32,
OUStringHash
sal_Int32
> BaseTypeMap;
struct ImplementationStatics
......
......@@ -125,11 +125,7 @@ css::uno::Sequence< sal_Int32 > string2intarray( const OUString & str );
css::uno::Sequence< OUString > convertMappedIntArray2StringArray(
const Int2StringMap &map, const css::uno::Sequence< sal_Int32> &source );
typedef std::unordered_map
<
OString,
OString,
OStringHash > String2StringMap;
typedef std::unordered_map< OString, OString > String2StringMap;
OUString querySingleValue(
const css::uno::Reference< css::sdbc::XConnection > &connection,
......
......@@ -88,8 +88,7 @@ public:
typedef std::unordered_map
<
OUString,
sal_Int32,
OUStringHash
sal_Int32
> String2IntMap;
typedef ::cppu::WeakComponentImplHelper
......
......@@ -46,7 +46,6 @@
using ::rtl::OUString;
using ::rtl::OUStringHash;
namespace
{
......@@ -102,14 +101,14 @@ struct FctPtrHash
// mapping from environment name to environment
typedef std::unordered_map<
OUString, uno_Environment *, OUStringHash > OUString2EnvironmentMap;
OUString, uno_Environment * > OUString2EnvironmentMap;
// mapping from ptr to object entry
typedef std::unordered_map<
void *, ObjectEntry *, FctPtrHash > Ptr2ObjectMap;
// mapping from oid to object entry
typedef std::unordered_map<
OUString, ObjectEntry *, OUStringHash > OId2ObjectMap;
OUString, ObjectEntry * > OId2ObjectMap;
struct EnvironmentsData
{
......
......@@ -50,7 +50,6 @@ using namespace osl;
using namespace com::sun::star::uno;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
using ::rtl::OUStringHash;
namespace cppu
{
......@@ -137,7 +136,7 @@ struct FctPtrHash
};
typedef std::unordered_map<
OUString, MappingEntry *, OUStringHash > t_OUString2Entry;
OUString, MappingEntry * > t_OUString2Entry;
typedef std::unordered_map<
uno_Mapping *, MappingEntry *, FctPtrHash > t_Mapping2Entry;
......
......@@ -55,7 +55,6 @@ using namespace ::com::sun::star;
using rtl::OUString;
using rtl::OUStringBuffer;
using rtl::OUStringHash;
namespace cppu
{
......@@ -138,7 +137,7 @@ protected:
, lateInit( lateInit_ )
{}
};
typedef std::unordered_map< OUString, ContextEntry * , OUStringHash > t_map;
typedef std::unordered_map< OUString, ContextEntry * > t_map;
t_map m_map;
Reference< lang::XMultiComponentFactory > m_xSMgr;
......
......@@ -766,7 +766,7 @@ SvxEntries* ContextMenuSaveInData::GetEntries()
{
if ( !m_pRootEntry )
{
typedef std::unordered_map< OUString, bool, OUStringHash > MenuInfo;
typedef std::unordered_map< OUString, bool > MenuInfo;
MenuInfo aMenuInfo;
m_pRootEntry.reset( new SvxConfigEntry( "ContextMenus", OUString(), true ) );
......@@ -2368,8 +2368,7 @@ OUString ToolbarSaveInData::GetSystemUIName( const OUString& rResourceURL )
SvxEntries* ToolbarSaveInData::GetEntries()
{
typedef std::unordered_map<OUString, bool,
OUStringHash > ToolbarInfo;
typedef std::unordered_map<OUString, bool > ToolbarInfo;
ToolbarInfo aToolbarInfo;
......@@ -2978,8 +2977,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( vcl::Window *pWindow,
pTbSymbol->set_height_request(aTbSize.Height());
pTbSymbol->SetStyle(pTbSymbol->GetStyle() | WB_SCROLL | WB_LINESPACING);
typedef std::unordered_map< OUString, bool,
OUStringHash > ImageInfo;
typedef std::unordered_map< OUString, bool > ImageInfo;
pTbSymbol->SetPageScroll( true );
......
......@@ -35,8 +35,7 @@
class SvTreeListBox;
typedef std::unordered_map< OUString, std::pair< OUString, OUString >,
OUStringHash > EventsHash;
typedef std::unordered_map< OUString, std::pair< OUString, OUString > > EventsHash;
struct EventDisplayName
{
......
......@@ -38,8 +38,7 @@
#define OBJTYPE_SCRIPTCONTAINER 3L
#define OBJTYPE_SFROOT 4L
typedef std::unordered_map < OUString, OUString,
OUStringHash > Selection_hash;
typedef std::unordered_map < OUString, OUString > Selection_hash;
class SFEntry;
......
......@@ -56,7 +56,7 @@ namespace dbaccess
}
};
typedef std::unordered_map< OUString, SubComponentDescriptor, OUStringHash > MapStringToCompDesc;
typedef std::unordered_map< OUString, SubComponentDescriptor > MapStringToCompDesc;
typedef std::map< SubComponentType, MapStringToCompDesc > MapCompTypeToCompDescs;
} // namespace dbaccess
......
......@@ -81,7 +81,7 @@ class DispatchWatcher : public ::cppu::WeakImplHelper< css::frame::XDispatchResu
private:
osl::Mutex m_mutex;
std::unordered_map<OUString, sal_Int32, OUStringHash> m_aRequestContainer;
std::unordered_map<OUString, sal_Int32> m_aRequestContainer;
sal_Int16 m_nRequestCount;
};
......
......@@ -28,7 +28,7 @@ namespace dp_misc
{
typedef std::unordered_map<
OString, OString, OStringHash > t_string2string_map;
OString, OString > t_string2string_map;
// Class to read obsolete registered extensions
// should be removed for LibreOffice 4.0
......
......@@ -38,8 +38,7 @@ namespace dp_manager {
typedef std::unordered_map<
OUString,
std::vector<css::uno::Reference<css::deployment::XPackage> >,
OUStringHash > id2extensions;
std::vector<css::uno::Reference<css::deployment::XPackage> > > id2extensions;
class ExtensionManager : private ::dp_misc::MutexHolder,
public ::cppu::WeakComponentImplHelper< css::deployment::XExtensionManager >
......
......@@ -47,8 +47,7 @@ class PackageManagerFactoryImpl : private MutexHolder, public t_pmfac_helper
Reference<deployment::XPackageManager> m_xTmpMgr;
Reference<deployment::XPackageManager> m_xBakMgr;
typedef std::unordered_map<
OUString, WeakReference<deployment::XPackageManager>,
OUStringHash > t_string2weakref;
OUString, WeakReference<deployment::XPackageManager> > t_string2weakref;
t_string2weakref m_managers;
protected:
......
......@@ -265,8 +265,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
bool m_unorc_modified;
bool bSwitchedRdbFiles;