summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-08-11 11:36:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-11 13:51:29 +0200
commitdb17a874af37350b3270932175854ee674447bc1 (patch)
treefecc983fb75d3a4072cc7bd344fc824d548deb0d /sd
parentdd8a400bbbb1b8d5592a870f2036a4df3d005a7d (diff)
convert std::map::insert to std::map::emplace II
Change-Id: Ief8bd59c903625ba65b75114b7b52c3b7ecbd331 Reviewed-on: https://gerrit.libreoffice.org/41019 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/slidesorter/cache/SlsBitmapCache.cxx12
-rw-r--r--sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx7
-rw-r--r--sd/source/ui/tools/PropertySet.cxx5
-rw-r--r--sd/source/ui/view/ViewShellManager.cxx3
4 files changed, 12 insertions, 15 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())
diff --git a/sd/source/ui/tools/PropertySet.cxx b/sd/source/ui/tools/PropertySet.cxx
index 33b2d7485804..d4aa8bd223e1 100644
--- a/sd/source/ui/tools/PropertySet.cxx
+++ b/sd/source/ui/tools/PropertySet.cxx
@@ -86,10 +86,7 @@ void SAL_CALL PropertySet::addPropertyChangeListener (
if (rBHelper.bDisposed || rBHelper.bInDispose)
return;
- mpChangeListeners->insert(
- ChangeListenerContainer::value_type(
- rsPropertyName,
- rxListener));
+ mpChangeListeners->emplace(rsPropertyName, rxListener);
}
void SAL_CALL PropertySet::removePropertyChangeListener (
diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx
index 137a51edc0b2..7fd7e6a8d438 100644
--- a/sd/source/ui/view/ViewShellManager.cxx
+++ b/sd/source/ui/view/ViewShellManager.cxx
@@ -529,8 +529,7 @@ void ViewShellManager::Implementation::ActivateSubShell (
// Create the sub shell list if it does not yet exist.
SubShellList::iterator iList (maActiveSubShells.find(&rParentShell));
if (iList == maActiveSubShells.end())
- iList = maActiveSubShells.insert(
- SubShellList::value_type(&rParentShell,SubShellSubList())).first;
+ iList = maActiveSubShells.emplace(&rParentShell,SubShellSubList()).first;
// Do not activate an object bar that is already active. Requesting
// this is not exactly an error but may be an indication of one.