[Libreoffice-commits] core.git: sd/source

Noel Grandin noel.grandin at collabora.co.uk
Thu Jan 4 06:25:32 UTC 2018


 sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx     |   32 ++++++-------
 sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx |   15 ++----
 2 files changed, 23 insertions(+), 24 deletions(-)

New commits:
commit 3f54055c18c953a8398bf29e27dcc8fae2592c94
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Jan 3 15:07:58 2018 +0200

    drop Cache typedef
    
    Change-Id: Id1c568f7d089c345643227a6e9d0fee09aabfab8
    Reviewed-on: https://gerrit.libreoffice.org/47345
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx
index 14a810712dfe..bffd9fd346d2 100644
--- a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx
@@ -61,11 +61,11 @@ class RecentlyUsedCacheDescriptor
 {
 public:
     Size maPreviewSize;
-    std::shared_ptr< ::sd::slidesorter::cache::PageCacheManager::Cache> mpCache;
+    std::shared_ptr< ::sd::slidesorter::cache::BitmapCache> mpCache;
 
     RecentlyUsedCacheDescriptor(
         const Size& rPreviewSize,
-        const std::shared_ptr< ::sd::slidesorter::cache::PageCacheManager::Cache>& rpCache)
+        const std::shared_ptr< ::sd::slidesorter::cache::BitmapCache>& rpCache)
         :maPreviewSize(rPreviewSize),mpCache(rpCache)
     {}
 };
@@ -110,7 +110,7 @@ namespace sd { namespace slidesorter { namespace cache {
 */
 class PageCacheManager::PageCacheContainer
     : public std::unordered_map<CacheDescriptor,
-                             std::shared_ptr<PageCacheManager::Cache>,
+                             std::shared_ptr<BitmapCache>,
                              CacheDescriptor::Hash,
                              CacheDescriptor::Equal>
 {
@@ -121,12 +121,12 @@ public:
         address only.
     */
     class CompareWithCache { public:
-        explicit CompareWithCache(const std::shared_ptr<PageCacheManager::Cache>& rpCache)
+        explicit CompareWithCache(const std::shared_ptr<BitmapCache>& rpCache)
             : mpCache(rpCache) {}
         bool operator () (const PageCacheContainer::value_type& rValue) const
         { return rValue.second == mpCache; }
     private:
-        std::shared_ptr<PageCacheManager::Cache> mpCache;
+        std::shared_ptr<BitmapCache> mpCache;
     };
 };
 
@@ -189,11 +189,11 @@ PageCacheManager::~PageCacheManager()
 {
 }
 
-std::shared_ptr<PageCacheManager::Cache> PageCacheManager::GetCache (
+std::shared_ptr<BitmapCache> PageCacheManager::GetCache (
     const DocumentKey& pDocument,
     const Size& rPreviewSize)
 {
-    std::shared_ptr<Cache> pResult;
+    std::shared_ptr<BitmapCache> pResult;
 
     // Look for the cache in the list of active caches.
     CacheDescriptor aKey (pDocument, rPreviewSize);
@@ -207,7 +207,7 @@ std::shared_ptr<PageCacheManager::Cache> PageCacheManager::GetCache (
 
     // Create the cache when no suitable one does exist.
     if (pResult.get() == nullptr)
-        pResult.reset(new Cache());
+        pResult.reset(new BitmapCache());
 
     // The cache may be newly created and thus empty or is old and may
     // contain previews that are not up-to-date.  Recycle previews from
@@ -222,7 +222,7 @@ std::shared_ptr<PageCacheManager::Cache> PageCacheManager::GetCache (
 }
 
 void PageCacheManager::Recycle (
-    const std::shared_ptr<Cache>& rpCache,
+    const std::shared_ptr<BitmapCache>& rpCache,
     const DocumentKey& pDocument,
     const Size& rPreviewSize)
 {
@@ -256,7 +256,7 @@ void PageCacheManager::Recycle (
     }
 }
 
-void PageCacheManager::ReleaseCache (const std::shared_ptr<Cache>& rpCache)
+void PageCacheManager::ReleaseCache (const std::shared_ptr<BitmapCache>& rpCache)
 {
     PageCacheContainer::iterator iCache (::std::find_if(
         mpPageCaches->begin(),
@@ -273,12 +273,12 @@ void PageCacheManager::ReleaseCache (const std::shared_ptr<Cache>& rpCache)
     }
 }
 
-std::shared_ptr<PageCacheManager::Cache> PageCacheManager::ChangeSize (
-    const std::shared_ptr<Cache>& rpCache,
+std::shared_ptr<BitmapCache> PageCacheManager::ChangeSize (
+    const std::shared_ptr<BitmapCache>& rpCache,
     const Size&,
     const Size& rNewPreviewSize)
 {
-    std::shared_ptr<Cache> pResult;
+    std::shared_ptr<BitmapCache> pResult;
 
     if (rpCache.get() != nullptr)
     {
@@ -384,11 +384,11 @@ void PageCacheManager::ReleasePreviewBitmap (const SdrPage* pPage)
         iCache->second->ReleaseBitmap(pPage);
 }
 
-std::shared_ptr<PageCacheManager::Cache> PageCacheManager::GetRecentlyUsedCache (
+std::shared_ptr<BitmapCache> PageCacheManager::GetRecentlyUsedCache (
     const DocumentKey& pDocument,
     const Size& rPreviewSize)
 {
-    std::shared_ptr<Cache> pCache;
+    std::shared_ptr<BitmapCache> pCache;
 
     // Look for the cache in the list of recently used caches.
     RecentlyUsedPageCaches::iterator iQueue (mpRecentlyUsedPageCaches->find(pDocument));
@@ -410,7 +410,7 @@ std::shared_ptr<PageCacheManager::Cache> PageCacheManager::GetRecentlyUsedCache
 void PageCacheManager::PutRecentlyUsedCache(
     DocumentKey const & pDocument,
     const Size& rPreviewSize,
-    const std::shared_ptr<Cache>& rpCache)
+    const std::shared_ptr<BitmapCache>& rpCache)
 {
     // Look up the list of recently used caches for the given document.
     RecentlyUsedPageCaches::iterator iQueue (mpRecentlyUsedPageCaches->find(pDocument));
diff --git a/sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx b/sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx
index 4d3efe48565b..fafb8605e887 100644
--- a/sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx
+++ b/sd/source/ui/slidesorter/inc/cache/SlsPageCacheManager.hxx
@@ -40,7 +40,6 @@ class BitmapCache;
 class PageCacheManager
 {
 public:
-    typedef BitmapCache Cache;
     typedef std::vector< std::pair<Size, std::shared_ptr<BitmapCache> > > BestFittingPageCaches;
     typedef css::uno::Reference<css::uno::XInterface> DocumentKey;
 
@@ -57,7 +56,7 @@ public:
             The returned cache lives as long as somebody keeps a shared
             pointer and the ReleaseCache() method has not been called.
     */
-    std::shared_ptr<Cache> GetCache (
+    std::shared_ptr<BitmapCache> GetCache (
         const  DocumentKey& pDocument,
         const Size& rPreviewSize);
 
@@ -65,14 +64,14 @@ public:
         cache.  After that the cache will live as long as the caller (and
         maybe others) holds its reference.
     */
-    void ReleaseCache (const std::shared_ptr<Cache>& rpCache);
+    void ReleaseCache (const std::shared_ptr<BitmapCache>& rpCache);
 
     /** This is an information to the cache manager that the size of preview
         bitmaps in the specified cache has changed.
 
     */
-    std::shared_ptr<Cache> ChangeSize (
-        const std::shared_ptr<Cache>& rpCache,
+    std::shared_ptr<BitmapCache> ChangeSize (
+        const std::shared_ptr<BitmapCache>& rpCache,
         const Size& rOldPreviewSize,
         const Size& rNewPreviewSize);
 
@@ -130,7 +129,7 @@ private:
     class Deleter;
     friend class Deleter;
 
-    std::shared_ptr<Cache> GetRecentlyUsedCache(
+    std::shared_ptr<BitmapCache> GetRecentlyUsedCache(
         const DocumentKey& pDocument,
         const Size& rSize);
 
@@ -141,13 +140,13 @@ private:
     void PutRecentlyUsedCache(
         DocumentKey const & pDocument,
         const Size& rPreviewSize,
-        const std::shared_ptr<Cache>& rpCache);
+        const std::shared_ptr<BitmapCache>& rpCache);
 
     /** This method is used internally to initialize a newly created
         BitmapCache with already exisiting previews.
     */
     void Recycle (
-        const std::shared_ptr<Cache>& rpCache,
+        const std::shared_ptr<BitmapCache>& rpCache,
         const DocumentKey& pDocument,
         const Size& rPreviewSize);
 };


More information about the Libreoffice-commits mailing list