diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-10 16:43:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-11 12:38:32 +0200 |
commit | d347c2403605c5aa3ddd98fb605366914acab79f (patch) | |
tree | e39624030741234c514bccd858e69d6318dfba68 /sd/source | |
parent | f0e68d4feaaa43f7450432ad1ebd92c2b572400f (diff) |
convert std::map::insert to std::map::emplace
which is considerably less verbose
Change-Id: Ifa373e8eb09e39bd6c8d3578641610a6055a187b
Reviewed-on: https://gerrit.libreoffice.org/40978
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/ToolBarManager.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/ViewShellManager.cxx | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx index fb8ed0af7395..fb733ce785b8 100644 --- a/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx +++ b/sd/source/ui/slidesorter/cache/SlsPageCacheManager.cxx @@ -215,7 +215,7 @@ std::shared_ptr<PageCacheManager::Cache> PageCacheManager::GetCache ( // Put the new (or old) cache into the container. if (pResult.get() != nullptr) - mpPageCaches->insert(PageCacheContainer::value_type(aKey, pResult)); + mpPageCaches->emplace(aKey, pResult); return pResult; } @@ -296,9 +296,9 @@ std::shared_ptr<PageCacheManager::Cache> PageCacheManager::ChangeSize ( const ::sd::slidesorter::cache::PageCacheManager::DocumentKey aKey ( iCacheToChange->first.mpDocument); mpPageCaches->erase(iCacheToChange); - mpPageCaches->insert(PageCacheContainer::value_type( + mpPageCaches->emplace( CacheDescriptor(aKey,rNewPreviewSize), - rpCache)); + rpCache); pResult = rpCache; } diff --git a/sd/source/ui/view/ToolBarManager.cxx b/sd/source/ui/view/ToolBarManager.cxx index 7fa2e7530942..b2ede96f664f 100644 --- a/sd/source/ui/view/ToolBarManager.cxx +++ b/sd/source/ui/view/ToolBarManager.cxx @@ -1220,7 +1220,7 @@ void ToolBarList::AddToolBar ( { Groups::iterator iGroup (maGroups.find(eGroup)); if (iGroup == maGroups.end()) - iGroup = maGroups.insert(Groups::value_type(eGroup,NameList())).first; + iGroup = maGroups.emplace(eGroup,NameList()).first; if (iGroup != maGroups.end()) { diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx index 451c1fc071a3..137a51edc0b2 100644 --- a/sd/source/ui/view/ViewShellManager.cxx +++ b/sd/source/ui/view/ViewShellManager.cxx @@ -386,7 +386,7 @@ void ViewShellManager::Implementation::AddShellFactory ( // Add the factory if it is not already present. if ( ! bAlreadyAdded) - maShellFactories.insert(FactoryList::value_type(pViewShell, rpFactory)); + maShellFactories.emplace(pViewShell, rpFactory); } void ViewShellManager::Implementation::RemoveShellFactory ( |