[Libreoffice-commits] core.git: 2 commits - sc/inc sc/source

Tor Lillqvist tml at collabora.com
Tue Aug 15 07:07:38 UTC 2017


 sc/inc/lookupcache.hxx              |    5 +----
 sc/source/core/data/documen2.cxx    |   10 +++++-----
 sc/source/core/tool/lookupcache.cxx |    2 +-
 3 files changed, 7 insertions(+), 10 deletions(-)

New commits:
commit 7172a7e4a64a67d43d16c2fbdbe9015fb5bf5a0c
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Aug 15 09:13:59 2017 +0300

    tdf#96099: Get rid of one more pointless typedef
    
    Change-Id: If50b022cabb0a94297cdb13c58f80884c33892d3

diff --git a/sc/inc/lookupcache.hxx b/sc/inc/lookupcache.hxx
index ef9d1521fad1..0997f6542811 100644
--- a/sc/inc/lookupcache.hxx
+++ b/sc/inc/lookupcache.hxx
@@ -191,8 +191,6 @@ private:
 
 };
 
-typedef std::unordered_map< ScRange, ScLookupCache*, ScLookupCache::Hash > ScLookupCacheMap;
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 3e2de5cb6d23..ac44da5278d2 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -111,7 +111,7 @@ using namespace com::sun::star;
 // dtor plus helpers are convenient.
 struct ScLookupCacheMapImpl
 {
-    ScLookupCacheMap aCacheMap;
+    std::unordered_map< ScRange, ScLookupCache*, ScLookupCache::Hash > aCacheMap;
     ~ScLookupCacheMapImpl()
     {
         freeCaches();
@@ -120,13 +120,13 @@ struct ScLookupCacheMapImpl
     {
         freeCaches();
         // free mapping
-        ScLookupCacheMap aTmp;
+        std::unordered_map< ScRange, ScLookupCache*, ScLookupCache::Hash > aTmp;
         aCacheMap.swap( aTmp);
     }
 private:
     void freeCaches()
     {
-        for (ScLookupCacheMap::iterator it( aCacheMap.begin()); it != aCacheMap.end(); ++it)
+        for (auto it( aCacheMap.begin()); it != aCacheMap.end(); ++it)
             delete (*it).second;
     }
 };
@@ -1232,7 +1232,7 @@ ScLookupCache & ScDocument::GetLookupCache( const ScRange & rRange )
     ScLookupCache* pCache = nullptr;
     if (!pLookupCacheMapImpl)
         pLookupCacheMapImpl = new ScLookupCacheMapImpl;
-    ScLookupCacheMap::iterator it( pLookupCacheMapImpl->aCacheMap.find( rRange));
+    auto it( pLookupCacheMapImpl->aCacheMap.find( rRange));
     if (it == pLookupCacheMapImpl->aCacheMap.end())
     {
         pCache = new ScLookupCache( this, rRange);
@@ -1256,7 +1256,7 @@ void ScDocument::AddLookupCache( ScLookupCache & rCache )
 
 void ScDocument::RemoveLookupCache( ScLookupCache & rCache )
 {
-    ScLookupCacheMap::iterator it( pLookupCacheMapImpl->aCacheMap.find(
+    auto it( pLookupCacheMapImpl->aCacheMap.find(
                 rCache.getRange()));
     if (it == pLookupCacheMapImpl->aCacheMap.end())
     {
commit b051f4baa9f25e5d00fca941162b4515c76331ec
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Aug 15 09:08:42 2017 +0300

    tdf#96099: Get rid of one more pointless typedef
    
    Change-Id: I669b020f2f251ef14cbfff78f6e186876ea0127c

diff --git a/sc/inc/lookupcache.hxx b/sc/inc/lookupcache.hxx
index 905df00e5860..ef9d1521fad1 100644
--- a/sc/inc/lookupcache.hxx
+++ b/sc/inc/lookupcache.hxx
@@ -182,8 +182,7 @@ private:
         }
     };
 
-    typedef std::unordered_map< QueryKey, QueryCriteriaAndResult, QueryKey::Hash > QueryMap;
-    QueryMap        maQueryMap;
+    std::unordered_map< QueryKey, QueryCriteriaAndResult, QueryKey::Hash > maQueryMap;
     ScRange         maRange;
     ScDocument *    mpDoc;
 
diff --git a/sc/source/core/tool/lookupcache.cxx b/sc/source/core/tool/lookupcache.cxx
index c0140d9046b6..d0258946ac20 100644
--- a/sc/source/core/tool/lookupcache.cxx
+++ b/sc/source/core/tool/lookupcache.cxx
@@ -79,7 +79,7 @@ ScLookupCache::~ScLookupCache()
 ScLookupCache::Result ScLookupCache::lookup( ScAddress & o_rResultAddress,
         const QueryCriteria & rCriteria, const ScAddress & rQueryAddress ) const
 {
-    QueryMap::const_iterator it( maQueryMap.find( QueryKey( rQueryAddress,
+    auto it( maQueryMap.find( QueryKey( rQueryAddress,
                     rCriteria.getQueryOp())));
     if (it == maQueryMap.end())
         return NOT_CACHED;


More information about the Libreoffice-commits mailing list