Kaydet (Commit) 7172a7e4 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

tdf#96099: Get rid of one more pointless typedef

Change-Id: If50b022cabb0a94297cdb13c58f80884c33892d3
üst b051f4ba
...@@ -191,8 +191,6 @@ private: ...@@ -191,8 +191,6 @@ private:
}; };
typedef std::unordered_map< ScRange, ScLookupCache*, ScLookupCache::Hash > ScLookupCacheMap;
#endif #endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -111,7 +111,7 @@ using namespace com::sun::star; ...@@ -111,7 +111,7 @@ using namespace com::sun::star;
// dtor plus helpers are convenient. // dtor plus helpers are convenient.
struct ScLookupCacheMapImpl struct ScLookupCacheMapImpl
{ {
ScLookupCacheMap aCacheMap; std::unordered_map< ScRange, ScLookupCache*, ScLookupCache::Hash > aCacheMap;
~ScLookupCacheMapImpl() ~ScLookupCacheMapImpl()
{ {
freeCaches(); freeCaches();
...@@ -120,13 +120,13 @@ struct ScLookupCacheMapImpl ...@@ -120,13 +120,13 @@ struct ScLookupCacheMapImpl
{ {
freeCaches(); freeCaches();
// free mapping // free mapping
ScLookupCacheMap aTmp; std::unordered_map< ScRange, ScLookupCache*, ScLookupCache::Hash > aTmp;
aCacheMap.swap( aTmp); aCacheMap.swap( aTmp);
} }
private: private:
void freeCaches() void freeCaches()
{ {
for (ScLookupCacheMap::iterator it( aCacheMap.begin()); it != aCacheMap.end(); ++it) for (auto it( aCacheMap.begin()); it != aCacheMap.end(); ++it)
delete (*it).second; delete (*it).second;
} }
}; };
...@@ -1232,7 +1232,7 @@ ScLookupCache & ScDocument::GetLookupCache( const ScRange & rRange ) ...@@ -1232,7 +1232,7 @@ ScLookupCache & ScDocument::GetLookupCache( const ScRange & rRange )
ScLookupCache* pCache = nullptr; ScLookupCache* pCache = nullptr;
if (!pLookupCacheMapImpl) if (!pLookupCacheMapImpl)
pLookupCacheMapImpl = new ScLookupCacheMapImpl; pLookupCacheMapImpl = new ScLookupCacheMapImpl;
ScLookupCacheMap::iterator it( pLookupCacheMapImpl->aCacheMap.find( rRange)); auto it( pLookupCacheMapImpl->aCacheMap.find( rRange));
if (it == pLookupCacheMapImpl->aCacheMap.end()) if (it == pLookupCacheMapImpl->aCacheMap.end())
{ {
pCache = new ScLookupCache( this, rRange); pCache = new ScLookupCache( this, rRange);
...@@ -1256,7 +1256,7 @@ void ScDocument::AddLookupCache( ScLookupCache & rCache ) ...@@ -1256,7 +1256,7 @@ void ScDocument::AddLookupCache( ScLookupCache & rCache )
void ScDocument::RemoveLookupCache( ScLookupCache & rCache ) void ScDocument::RemoveLookupCache( ScLookupCache & rCache )
{ {
ScLookupCacheMap::iterator it( pLookupCacheMapImpl->aCacheMap.find( auto it( pLookupCacheMapImpl->aCacheMap.find(
rCache.getRange())); rCache.getRange()));
if (it == pLookupCacheMapImpl->aCacheMap.end()) if (it == pLookupCacheMapImpl->aCacheMap.end())
{ {
......
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