Kaydet (Commit) 9d6257a9 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Get rid of a few unused or once-used typedefs

This code is complicated enough without weirdly named typedefs for
trivial iterators. Just use 'auto'.

Change-Id: Ib2d9271ccd0f63eab338d9fe214a2523cb57ce97
Reviewed-on: https://gerrit.libreoffice.org/49510Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarTor Lillqvist <tml@collabora.com>
üst 7b8c631a
......@@ -115,7 +115,7 @@ IUnknownWrapper_Impl::~IUnknownWrapper_Impl()
WrapperToAdapterMap.erase( it);
}
IT_Com it_c= ComPtrToWrapperMap.find( reinterpret_cast<sal_uIntPtr>(m_spUnknown.p));
auto it_c= ComPtrToWrapperMap.find( reinterpret_cast<sal_uIntPtr>(m_spUnknown.p));
if(it_c != ComPtrToWrapperMap.end())
ComPtrToWrapperMap.erase(it_c);
}
......
......@@ -63,15 +63,12 @@ namespace ole_adapter
{
extern std::unordered_map<sal_uIntPtr, sal_uIntPtr> AdapterToWrapperMap;
extern std::unordered_map<sal_uIntPtr, sal_uIntPtr> WrapperToAdapterMap;
typedef std::unordered_map<sal_uIntPtr, sal_uIntPtr>::iterator IT_Wrap;
typedef std::unordered_map<sal_uIntPtr, sal_uIntPtr>::iterator CIT_Wrap;
//Maps IUnknown pointers to a weak reference of the respective wrapper class (e.g.
// IUnknownWrapperImpl. It is the responsibility of the wrapper to remove the entry when
// it is being destroyed.
// Used to ensure that an Automation object is always mapped to the same UNO objects.
extern std::unordered_map<sal_uIntPtr, WeakReference<XInterface> > ComPtrToWrapperMap;
typedef std::unordered_map<sal_uIntPtr, WeakReference<XInterface> >::iterator IT_Com;
typedef std::unordered_map<sal_uIntPtr, WeakReference<XInterface> >::const_iterator CIT_Com;
// Maps XInterface pointers to a weak reference of its wrapper class (i.e.
// InterfaceOleWrapper_Impl). It is the responsibility of the wrapper to remove the entry when
......@@ -80,8 +77,6 @@ typedef std::unordered_map<sal_uIntPtr, WeakReference<XInterface> >::const_itera
// UNO interface is mapped again to COM then the IDispach of the first mapped instance
// must be returned.
extern std::unordered_map<sal_uIntPtr, WeakReference<XInterface> > UnoObjToWrapperMap;
typedef std::unordered_map<sal_uIntPtr, WeakReference<XInterface> >::iterator IT_Uno;
typedef std::unordered_map<sal_uIntPtr, WeakReference<XInterface> >::const_iterator CIT_Uno;
// createUnoObjectWrapper gets a wrapper instance by calling createUnoWrapperInstance
// and initializes it via XInitialization. The wrapper object is required to implement
......@@ -1368,7 +1363,7 @@ void UnoConversionUtilities<T>::createUnoObjectWrapper(const Any & rObj, VARIANT
Reference<XInterface> xIntWrapper;
// Does a UNO wrapper exist already ?
IT_Uno it_uno = UnoObjToWrapperMap.find( reinterpret_cast<sal_uIntPtr>(xInt.get()));
auto it_uno = UnoObjToWrapperMap.find( reinterpret_cast<sal_uIntPtr>(xInt.get()));
if(it_uno != UnoObjToWrapperMap.end())
{
xIntWrapper = it_uno->second;
......@@ -1383,9 +1378,9 @@ void UnoConversionUtilities<T>::createUnoObjectWrapper(const Any & rObj, VARIANT
else
{
Reference<XInterface> xIntComWrapper = xInt;
typedef std::unordered_map<sal_uIntPtr,sal_uIntPtr>::iterator IT;
// Adapter? then get the COM wrapper to which the adapter delegates its calls
IT it= AdapterToWrapperMap.find( reinterpret_cast<sal_uIntPtr>(xInt.get()));
auto it = AdapterToWrapperMap.find( reinterpret_cast<sal_uIntPtr>(xInt.get()));
if( it != AdapterToWrapperMap.end() )
xIntComWrapper= reinterpret_cast<XInterface*>(it->second);
......@@ -1729,7 +1724,7 @@ Any UnoConversionUtilities<T>::createOleObjectWrapper(VARIANT* pVar, const Type&
// wrap ordinary dispatch objects. The dispatch-UNO objects usually are adapted to represent
// particular UNO interfaces.
Reference<XInterface> xIntWrapper;
CIT_Com cit_currWrapper= ComPtrToWrapperMap.find( reinterpret_cast<sal_uIntPtr>(spUnknown.p));
auto cit_currWrapper= ComPtrToWrapperMap.find( reinterpret_cast<sal_uIntPtr>(spUnknown.p));
if(cit_currWrapper != ComPtrToWrapperMap.end())
xIntWrapper = cit_currWrapper->second;
if (xIntWrapper.is())
......@@ -1738,7 +1733,7 @@ Any UnoConversionUtilities<T>::createOleObjectWrapper(VARIANT* pVar, const Type&
//find the proper Adapter. The pointer in the WrapperToAdapterMap are valid as long as
//we get a pointer to the wrapper from ComPtrToWrapperMap, because the Adapter hold references
//to the wrapper.
CIT_Wrap it = WrapperToAdapterMap.find(reinterpret_cast<sal_uIntPtr>(xIntWrapper.get()));
auto it = WrapperToAdapterMap.find(reinterpret_cast<sal_uIntPtr>(xIntWrapper.get()));
if (it == WrapperToAdapterMap.end())
{
// No adapter available.
......
......@@ -100,7 +100,7 @@ InterfaceOleWrapper_Impl::~InterfaceOleWrapper_Impl()
{
MutexGuard guard(getBridgeMutex());
// remove entries in global map
IT_Uno it= UnoObjToWrapperMap.find( reinterpret_cast<sal_uIntPtr>(m_xOrigin.get()));
auto it = UnoObjToWrapperMap.find( reinterpret_cast<sal_uIntPtr>(m_xOrigin.get()));
if(it != UnoObjToWrapperMap.end())
UnoObjToWrapperMap.erase(it);
}
......
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