diff options
Diffstat (limited to 'sd/source/ui/slidesorter')
-rw-r--r-- | sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx | 7 |
2 files changed, 10 insertions, 9 deletions
diff --git a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx index b45c2ade3cd0..2a5b300410df 100644 --- a/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx +++ b/sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx @@ -273,9 +273,9 @@ void BitmapCache::SetBitmap ( } else { - iEntry = mpBitmapContainer->insert(CacheBitmapContainer::value_type ( + iEntry = mpBitmapContainer->emplace( rKey, - CacheEntry(rPreview, mnCurrentAccessTime++, bIsPrecious)) + CacheEntry(rPreview, mnCurrentAccessTime++, bIsPrecious) ).first; } @@ -315,9 +315,9 @@ void BitmapCache::SetPrecious (const CacheKey& rKey, bool bIsPrecious) } else if (bIsPrecious) { - iEntry = mpBitmapContainer->insert(CacheBitmapContainer::value_type ( + iEntry = mpBitmapContainer->emplace( rKey, - CacheEntry(Bitmap(), mnCurrentAccessTime++, bIsPrecious)) + CacheEntry(Bitmap(), mnCurrentAccessTime++, bIsPrecious) ).first; UpdateCacheSize(iEntry->second, ADD); } @@ -354,9 +354,9 @@ void BitmapCache::Recycle (const BitmapCache& rCache) CacheBitmapContainer::iterator iEntry (mpBitmapContainer->find(iOtherEntry->first)); if (iEntry == mpBitmapContainer->end()) { - iEntry = mpBitmapContainer->insert(CacheBitmapContainer::value_type ( + iEntry = mpBitmapContainer->emplace( iOtherEntry->first, - CacheEntry(mnCurrentAccessTime++, true)) + CacheEntry(mnCurrentAccessTime++, true) ).first; UpdateCacheSize(iEntry->second, ADD); } diff --git a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx index fb733ce785b8..a2d93d23a48a 100644 --- a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx +++ b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx @@ -147,7 +147,8 @@ public: iterator end() { return maMap.end(); } void clear() { maMap.clear(); } iterator find(const key_type& key) { return maMap.find(key); } - std::pair<iterator,bool> insert(const value_type& value) { return maMap.insert(value); } + template<class... Args> + std::pair<iterator,bool> emplace(Args&&... args) { return maMap.emplace(std::forward<Args>(args)...); } }; class PageCacheManager::Deleter @@ -414,8 +415,8 @@ void PageCacheManager::PutRecentlyUsedCache( // Look up the list of recently used caches for the given document. RecentlyUsedPageCaches::iterator iQueue (mpRecentlyUsedPageCaches->find(pDocument)); if (iQueue == mpRecentlyUsedPageCaches->end()) - iQueue = mpRecentlyUsedPageCaches->insert( - RecentlyUsedPageCaches::value_type(pDocument, RecentlyUsedQueue()) + iQueue = mpRecentlyUsedPageCaches->emplace( + pDocument, RecentlyUsedQueue() ).first; if (iQueue != mpRecentlyUsedPageCaches->end()) |