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 /svtools | |
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 'svtools')
-rw-r--r-- | svtools/source/config/extcolorcfg.cxx | 8 | ||||
-rw-r--r-- | svtools/source/dialogs/roadmapwizard.cxx | 2 | ||||
-rw-r--r-- | svtools/source/uno/framestatuslistener.cxx | 2 | ||||
-rw-r--r-- | svtools/source/uno/generictoolboxcontroller.cxx | 2 | ||||
-rw-r--r-- | svtools/source/uno/statusbarcontroller.cxx | 6 | ||||
-rw-r--r-- | svtools/source/uno/toolboxcontroller.cxx | 6 |
6 files changed, 13 insertions, 13 deletions
diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx index a8bb0b0d3243..6f360bf82aae 100644 --- a/svtools/source/config/extcolorcfg.cxx +++ b/svtools/source/config/extcolorcfg.cxx @@ -242,7 +242,7 @@ void ExtendedColorConfig_Impl::Load(const OUString& rScheme) if ( aComponentDisplayNamesValue.getLength() && (aComponentDisplayNamesValue[0] >>= sComponentDisplayName) ) { sal_Int32 nIndex = 0; - m_aComponentDisplayNames.insert(TDisplayNames::value_type(componentName.getToken(1,'/',nIndex),sComponentDisplayName)); + m_aComponentDisplayNames.emplace(componentName.getToken(1,'/',nIndex),sComponentDisplayName); } componentName += "/Entries"; @@ -261,7 +261,7 @@ void ExtendedColorConfig_Impl::Load(const OUString& rScheme) sName = sName.copy(0,sName.lastIndexOf(sDisplayName)); OUString sCurrentDisplayName; aDisplayNamesValue[j] >>= sCurrentDisplayName; - aDisplayNameMap.insert(TDisplayNames::value_type(sName,sCurrentDisplayName)); + aDisplayNameMap.emplace(sName,sCurrentDisplayName); } } @@ -332,7 +332,7 @@ void ExtendedColorConfig_Impl::FillComponentColors(uno::Sequence < OUString >& _ OUString* pColorIter = aColorNames.getArray(); OUString* pColorEnd = pColorIter + aColorNames.getLength(); - m_aConfigValuesPos.push_back(m_aConfigValues.insert(TComponents::value_type(sComponentName,TComponentMapping(TConfigValues(),TMapPos()))).first); + m_aConfigValuesPos.push_back(m_aConfigValues.emplace(sComponentName,TComponentMapping(TConfigValues(),TMapPos())).first); TConfigValues& aConfigValues = (*m_aConfigValuesPos.rbegin())->second.first; TMapPos& aConfigValuesPos = (*m_aConfigValuesPos.rbegin())->second.second; for(int i = 0; pColorIter != pColorEnd; ++pColorIter ,++i) @@ -360,7 +360,7 @@ void ExtendedColorConfig_Impl::FillComponentColors(uno::Sequence < OUString >& _ else nDefaultColor = nColor; ExtendedColorConfigValue aValue(sName,sDisplayName,nColor,nDefaultColor); - aConfigValuesPos.push_back(aConfigValues.insert(TConfigValues::value_type(sName,aValue)).first); + aConfigValuesPos.push_back(aConfigValues.emplace(sName,aValue).first); } } // for(int i = 0; pColorIter != pColorEnd; ++pColorIter ,++i) } diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx index 661169dcad47..a0bcb0409a99 100644 --- a/svtools/source/dialogs/roadmapwizard.cxx +++ b/svtools/source/dialogs/roadmapwizard.cxx @@ -169,7 +169,7 @@ namespace svt void RoadmapWizard::declarePath( PathId _nPathId, const WizardPath& _lWizardStates) { - m_pImpl->aPaths.insert( Paths::value_type( _nPathId, _lWizardStates ) ); + m_pImpl->aPaths.emplace( _nPathId, _lWizardStates ); if ( m_pImpl->aPaths.size() == 1 ) // the very first path -> activate it diff --git a/svtools/source/uno/framestatuslistener.cxx b/svtools/source/uno/framestatuslistener.cxx index 4f135b946f87..0985d618bb3d 100644 --- a/svtools/source/uno/framestatuslistener.cxx +++ b/svtools/source/uno/framestatuslistener.cxx @@ -187,7 +187,7 @@ void FrameStatusListener::addStatusListener( const OUString& aCommandURL ) } } else - m_aListenerMap.insert( URLToDispatchMap::value_type( aCommandURL, xDispatch )); + m_aListenerMap.emplace( aCommandURL, xDispatch ); } } diff --git a/svtools/source/uno/generictoolboxcontroller.cxx b/svtools/source/uno/generictoolboxcontroller.cxx index d74953b163b2..b755ac147caa 100644 --- a/svtools/source/uno/generictoolboxcontroller.cxx +++ b/svtools/source/uno/generictoolboxcontroller.cxx @@ -60,7 +60,7 @@ GenericToolboxController::GenericToolboxController( const Reference< XComponentC // insert main command to our listener map if ( !m_aCommandURL.isEmpty() ) - m_aListenerMap.insert( URLToDispatchMap::value_type( aCommand, Reference< XDispatch >() )); + m_aListenerMap.emplace( aCommand, Reference< XDispatch >() ); } GenericToolboxController::~GenericToolboxController() diff --git a/svtools/source/uno/statusbarcontroller.cxx b/svtools/source/uno/statusbarcontroller.cxx index fecabd21ad2a..94433e733fbd 100644 --- a/svtools/source/uno/statusbarcontroller.cxx +++ b/svtools/source/uno/statusbarcontroller.cxx @@ -162,7 +162,7 @@ void SAL_CALL StatusbarController::initialize( const Sequence< Any >& aArguments } if ( !m_aCommandURL.isEmpty() ) - m_aListenerMap.insert( URLToDispatchMap::value_type( m_aCommandURL, Reference< XDispatch >() )); + m_aListenerMap.emplace( m_aCommandURL, Reference< XDispatch >() ); } } @@ -357,7 +357,7 @@ void StatusbarController::addStatusListener( const OUString& aCommandURL ) if ( !m_bInitialized ) { // Put into the unordered_map of status listener. Will be activated when initialized is called - m_aListenerMap.insert( URLToDispatchMap::value_type( aCommandURL, Reference< XDispatch >() )); + m_aListenerMap.emplace( aCommandURL, Reference< XDispatch >() ); return; } else @@ -388,7 +388,7 @@ void StatusbarController::addStatusListener( const OUString& aCommandURL ) } } else - m_aListenerMap.insert( URLToDispatchMap::value_type( aCommandURL, xDispatch )); + m_aListenerMap.emplace( aCommandURL, xDispatch ); } } } diff --git a/svtools/source/uno/toolboxcontroller.cxx b/svtools/source/uno/toolboxcontroller.cxx index 857bc90cddc3..848a1b065d69 100644 --- a/svtools/source/uno/toolboxcontroller.cxx +++ b/svtools/source/uno/toolboxcontroller.cxx @@ -211,7 +211,7 @@ void SAL_CALL ToolboxController::initialize( const Sequence< Any >& aArguments ) } if ( !m_aCommandURL.isEmpty() ) - m_aListenerMap.insert( URLToDispatchMap::value_type( m_aCommandURL, Reference< XDispatch >() )); + m_aListenerMap.emplace( m_aCommandURL, Reference< XDispatch >() ); } } @@ -391,7 +391,7 @@ void ToolboxController::addStatusListener( const OUString& aCommandURL ) if ( !m_bInitialized ) { // Put into the unordered_map of status listener. Will be activated when initialized is called - m_aListenerMap.insert( URLToDispatchMap::value_type( aCommandURL, Reference< XDispatch >() )); + m_aListenerMap.emplace( aCommandURL, Reference< XDispatch >() ); return; } else @@ -422,7 +422,7 @@ void ToolboxController::addStatusListener( const OUString& aCommandURL ) } } else - m_aListenerMap.insert( URLToDispatchMap::value_type( aCommandURL, xDispatch )); + m_aListenerMap.emplace( aCommandURL, xDispatch ); } } } |