summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-04-07 18:14:32 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-04-07 18:14:53 +0200
commitf57c9921de4d64fbe27e80e2e7c13dea23853089 (patch)
treea5740ad9b06c76097459cb50d6b8a374b002e74f /framework
parentd56deaeb2a1e8007e50fc2334f416fddd4e3cde3 (diff)
Get rid of BaseHash wrapper (to unbreak Windows build)
Change-Id: Ieae7d6af7a4753958ebf2aeae9d2ae6fafe5efe9
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/classes/filtercachedata.hxx6
-rw-r--r--framework/inc/classes/protocolhandlercache.hxx4
-rw-r--r--framework/inc/stdtypes.h21
-rw-r--r--framework/inc/uiconfiguration/graphicnameaccess.hxx2
-rw-r--r--framework/inc/uielement/commandinfo.hxx2
-rw-r--r--framework/inc/uielement/toolbarmanager.hxx2
-rw-r--r--framework/source/dispatch/dispatchinformationprovider.cxx7
-rw-r--r--framework/source/fwi/classes/protocolhandlercache.cxx4
-rw-r--r--framework/source/inc/accelerators/acceleratorcache.hxx2
-rw-r--r--framework/source/inc/accelerators/keymapping.hxx2
-rw-r--r--framework/source/services/frame.cxx4
-rw-r--r--framework/source/services/pathsettings.cxx2
12 files changed, 17 insertions, 41 deletions
diff --git a/framework/inc/classes/filtercachedata.hxx b/framework/inc/classes/filtercachedata.hxx
index f6716786aa9b..928ce9998203 100644
--- a/framework/inc/classes/filtercachedata.hxx
+++ b/framework/inc/classes/filtercachedata.hxx
@@ -85,7 +85,7 @@ struct FileType
sMediaType.clear();
sClipboardFormat.clear();
nDocumentIconID = 0;
- lUINames.free ();
+ lUINames.clear();
framework::free(lURLPattern);
framework::free(lExtensions);
}
@@ -147,7 +147,7 @@ struct Filter
nFlags = 0;
nFileFormatVersion = 0;
sTemplateName.clear();
- lUINames.free();
+ lUINames.clear();
framework::free(lUserData);
}
@@ -244,7 +244,7 @@ struct Loader
inline void impl_clear()
{
sName.clear();
- lUINames.free();
+ lUINames.clear();
framework::free(lTypes);
}
diff --git a/framework/inc/classes/protocolhandlercache.hxx b/framework/inc/classes/protocolhandlercache.hxx
index 9537677acccd..cb9c66a8b651 100644
--- a/framework/inc/classes/protocolhandlercache.hxx
+++ b/framework/inc/classes/protocolhandlercache.hxx
@@ -60,7 +60,7 @@ struct FWI_DLLPUBLIC ProtocolHandler
uno implementation names as value. Overloading of the index operator makes it possible
to search for a key by using a full qualified URL on list of all possible pattern keys.
*/
-class FWI_DLLPUBLIC PatternHash : public BaseHash< OUString >
+class FWI_DLLPUBLIC PatternHash : public std::unordered_map<OUString, OUString, OUStringHash>
{
/* interface */
public:
@@ -71,7 +71,7 @@ class FWI_DLLPUBLIC PatternHash : public BaseHash< OUString >
/**
This hash holds protocol handler structs by her names.
*/
-typedef BaseHash< ProtocolHandler > HandlerHash;
+typedef std::unordered_map<OUString, ProtocolHandler, OUStringHash> HandlerHash;
/**
@short this hash makes it easy to find a protocol handler by using his uno implementation name.
diff --git a/framework/inc/stdtypes.h b/framework/inc/stdtypes.h
index 407ecfa930b0..b87247e85b83 100644
--- a/framework/inc/stdtypes.h
+++ b/framework/inc/stdtypes.h
@@ -88,29 +88,10 @@ void free(std::vector<T>& vec)
}
/**
- Basic hash based on a std::unordered_map() which provides key=[OUString] and value=[template type] pairs
- It implements some additional funtionality which can be useful but
- is missing at the normal hash implementation.
-*/
-template< class TType >
-class BaseHash : public std::unordered_map< OUString ,
- TType ,
- OUStringHash >
-{
- public:
-
- // the only way to free used memory really!
- void free()
- {
- BaseHash().swap( *this );// get rid of reserved capacity
- }
-};
-
-/**
Basic OUString hash.
Key and values are OUStrings.
*/
-typedef BaseHash< OUString > OUStringHashMap;
+typedef std::unordered_map<OUString, OUString, OUStringHash> OUStringHashMap;
/**
It can be used to map names (e.g. of properties) to her corresponding handles.
diff --git a/framework/inc/uiconfiguration/graphicnameaccess.hxx b/framework/inc/uiconfiguration/graphicnameaccess.hxx
index b299b8493015..b18ab5c7d3bc 100644
--- a/framework/inc/uiconfiguration/graphicnameaccess.hxx
+++ b/framework/inc/uiconfiguration/graphicnameaccess.hxx
@@ -52,7 +52,7 @@ namespace framework
throw(css::uno::RuntimeException, std::exception) override;
private:
- typedef BaseHash< css::uno::Reference< css::graphic::XGraphic > > NameGraphicHashMap;
+ typedef std::unordered_map<OUString, css::uno::Reference< css::graphic::XGraphic >, OUStringHash> NameGraphicHashMap;
NameGraphicHashMap m_aNameToElementMap;
css::uno::Sequence< OUString > m_aSeq;
};
diff --git a/framework/inc/uielement/commandinfo.hxx b/framework/inc/uielement/commandinfo.hxx
index a6db494b86ff..a322c854af9f 100644
--- a/framework/inc/uielement/commandinfo.hxx
+++ b/framework/inc/uielement/commandinfo.hxx
@@ -35,7 +35,7 @@ struct CommandInfo
sal_Int16 nImageInfo;
};
-typedef BaseHash< CommandInfo > CommandToInfoMap;
+typedef std::unordered_map<OUString, CommandInfo, OUStringHash> CommandToInfoMap;
} // namespace framework
diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx
index cd912f1adb3d..be165b4302d9 100644
--- a/framework/inc/uielement/toolbarmanager.hxx
+++ b/framework/inc/uielement/toolbarmanager.hxx
@@ -153,7 +153,7 @@ class ToolBarManager : public ToolbarManager_Base
protected:
typedef std::unordered_map< sal_uInt16, css::uno::Reference< css::frame::XStatusListener > > ToolBarControllerMap;
typedef ::std::vector< css::uno::Reference< css::frame::XSubToolbarController > > SubToolBarControllerVector;
- typedef BaseHash< SubToolBarControllerVector > SubToolBarToSubToolBarControllerMap;
+ typedef std::unordered_map<OUString, SubToolBarControllerVector, OUStringHash> SubToolBarToSubToolBarControllerMap;
typedef std::unordered_map< sal_uInt16, css::uno::Reference< css::container::XIndexAccess > > MenuDescriptionMap;
diff --git a/framework/source/dispatch/dispatchinformationprovider.cxx b/framework/source/dispatch/dispatchinformationprovider.cxx
index 9d0464faf4d4..86a86618867c 100644
--- a/framework/source/dispatch/dispatchinformationprovider.cxx
+++ b/framework/source/dispatch/dispatchinformationprovider.cxx
@@ -79,7 +79,7 @@ css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL DispatchInformati
sal_Int32 c1 = lProvider.getLength();
sal_Int32 i1 = 0;
- BaseHash< css::frame::DispatchInformation > lInfos;
+ std::unordered_map<OUString, css::frame::DispatchInformation, OUStringHash> lInfos;
for (i1=0; i1<c1; ++i1)
{
@@ -96,7 +96,7 @@ css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL DispatchInformati
for (i2=0; i2<c2; ++i2)
{
const css::frame::DispatchInformation& rInfo = lProviderInfos[i2];
- BaseHash< css::frame::DispatchInformation >::const_iterator pInfo = lInfos.find(rInfo.Command);
+ auto pInfo = lInfos.find(rInfo.Command);
if (pInfo == lInfos.end())
lInfos[rInfo.Command] = rInfo;
}
@@ -111,8 +111,7 @@ css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL DispatchInformati
i1 = 0;
css::uno::Sequence< css::frame::DispatchInformation > lReturn(c1);
- BaseHash< css::frame::DispatchInformation >::const_iterator pStepp;
- for ( pStepp = lInfos.begin();
+ for (auto pStepp = lInfos.begin();
pStepp != lInfos.end () && i1<c1;
++pStepp, ++i1 )
{
diff --git a/framework/source/fwi/classes/protocolhandlercache.cxx b/framework/source/fwi/classes/protocolhandlercache.cxx
index ebbc6e8f925c..ef48ef01105c 100644
--- a/framework/source/fwi/classes/protocolhandlercache.cxx
+++ b/framework/source/fwi/classes/protocolhandlercache.cxx
@@ -108,8 +108,6 @@ HandlerCache::~HandlerCache()
if( m_nRefCount==1)
{
m_pConfig->setCache(nullptr);
- m_pHandler->free();
- m_pPattern->free();
delete m_pConfig;
delete m_pHandler;
@@ -164,8 +162,6 @@ void HandlerCache::takeOver(HandlerHash* pHandler, PatternHash* pPattern)
m_pHandler = pHandler;
m_pPattern = pPattern;
- pOldHandler->free();
- pOldPattern->free();
delete pOldHandler;
delete pOldPattern;
}
diff --git a/framework/source/inc/accelerators/acceleratorcache.hxx b/framework/source/inc/accelerators/acceleratorcache.hxx
index 07c0cf877b94..2f59e4f73184 100644
--- a/framework/source/inc/accelerators/acceleratorcache.hxx
+++ b/framework/source/inc/accelerators/acceleratorcache.hxx
@@ -52,7 +52,7 @@ class AcceleratorCache
commands -> keys
*/
typedef ::std::vector< css::awt::KeyEvent > TKeyList;
- typedef BaseHash< TKeyList > TCommand2Keys;
+ typedef std::unordered_map<OUString, TKeyList, OUStringHash> TCommand2Keys;
/** TODO document me
keys -> commands
diff --git a/framework/source/inc/accelerators/keymapping.hxx b/framework/source/inc/accelerators/keymapping.hxx
index d51046f09d37..4edc2681dcc5 100644
--- a/framework/source/inc/accelerators/keymapping.hxx
+++ b/framework/source/inc/accelerators/keymapping.hxx
@@ -52,7 +52,7 @@ class KeyMapping
};
/** @short hash structure to map identifier to key codes. */
- typedef BaseHash< sal_Int16 > Identifier2CodeHash;
+ typedef std::unordered_map<OUString, sal_Int16, OUStringHash> Identifier2CodeHash;
/** @short hash structure to map key codes to identifier. */
typedef std::unordered_map< sal_Int16 ,
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index b24bf35db129..6a96a39859f6 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -492,7 +492,7 @@ private:
WindowCommandDispatch* m_pWindowCommandDispatch;
- typedef BaseHash< css::beans::Property > TPropInfoHash;
+ typedef std::unordered_map<OUString, css::beans::Property, OUStringHash> TPropInfoHash;
TPropInfoHash m_lProps;
ListenerHash m_lSimpleChangeListener;
@@ -3108,7 +3108,7 @@ void SAL_CALL Frame::impl_disablePropertySet()
m_lSimpleChangeListener.disposeAndClear(aEvent);
m_lVetoChangeListener.disposeAndClear(aEvent);
- m_lProps.free();
+ m_lProps.clear();
}
bool Frame::impl_existsVeto(const css::beans::PropertyChangeEvent& aEvent)
diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx
index 552b2e8cc650..149987d96f43 100644
--- a/framework/source/services/pathsettings.cxx
+++ b/framework/source/services/pathsettings.cxx
@@ -136,7 +136,7 @@ class PathSettings : private cppu::BaseMutex
bool bIsReadonly;
};
- typedef BaseHash< PathSettings::PathInfo > PathHash;
+ typedef std::unordered_map<OUString, PathSettings::PathInfo, OUStringHash> PathHash;
enum EChangeOp
{