From d347c2403605c5aa3ddd98fb605366914acab79f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 10 Aug 2017 16:43:55 +0200 Subject: 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 Reviewed-by: Noel Grandin --- unotools/source/config/cmdoptions.cxx | 2 +- unotools/source/config/extendedsecurityoptions.cxx | 2 +- unotools/source/config/optionsdlg.cxx | 2 +- unotools/source/config/pathoptions.cxx | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'unotools/source') diff --git a/unotools/source/config/cmdoptions.cxx b/unotools/source/config/cmdoptions.cxx index f9be432a9a7a..5f1eac638403 100644 --- a/unotools/source/config/cmdoptions.cxx +++ b/unotools/source/config/cmdoptions.cxx @@ -74,7 +74,7 @@ class SvtCmdOptions void AddCommand( const OUString& aCmd ) { - m_aCommandHashMap.insert( CommandHashMap::value_type( aCmd, 0 ) ); + m_aCommandHashMap.emplace( aCmd, 0 ); } private: diff --git a/unotools/source/config/extendedsecurityoptions.cxx b/unotools/source/config/extendedsecurityoptions.cxx index 0d680c304d27..7a9630595189 100644 --- a/unotools/source/config/extendedsecurityoptions.cxx +++ b/unotools/source/config/extendedsecurityoptions.cxx @@ -211,7 +211,7 @@ void SvtExtendedSecurityOptions_Impl::FillExtensionHashMap( ExtensionHashMap& aH // Don't use value if sequence has not the correct length if ( aValues[0] >>= aValue ) // Add extension into secure extensions hash map - aHashMap.insert( ExtensionHashMap::value_type( aValue.toAsciiLowerCase(), 1 ) ); + aHashMap.emplace( aValue.toAsciiLowerCase(), 1 ); else { SAL_WARN( "unotools.config", "SvtExtendedSecurityOptions_Impl::FillExtensionHashMap(): not string value?" ); diff --git a/unotools/source/config/optionsdlg.cxx b/unotools/source/config/optionsdlg.cxx index 471dad5a365e..7da3f2305455 100644 --- a/unotools/source/config/optionsdlg.cxx +++ b/unotools/source/config/optionsdlg.cxx @@ -144,7 +144,7 @@ void SvtOptionsDlgOptions_Impl::ReadNode( const OUString& _rNode, NodeType _eTyp aValues = GetProperties( lResult ); bool bHide = false; if ( aValues[0] >>= bHide ) - m_aOptionNodeList.insert( OptionNodeList::value_type( sNode, bHide ) ); + m_aOptionNodeList.emplace( sNode, bHide ); if ( _eType != NT_Option ) { diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index d6675cd31333..c8925967c875 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -412,7 +412,7 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() : for ( sal_Int32 n = 0; n < aPathPropSeq.getLength(); n++ ) { const css::beans::Property& aProperty = aPathPropSeq[n]; - aTempHashMap.insert( NameToHandleMap::value_type( aProperty.Name, aProperty.Handle )); + aTempHashMap.emplace(aProperty.Name, aProperty.Handle); } // Create mapping between internal enum (SvtPathOptions::Paths) and property handle @@ -425,7 +425,7 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() : { sal_Int32 nHandle = pIter->second; sal_Int32 nEnum = p.ePath; - m_aMapEnumToPropHandle.insert( EnumToHandleMap::value_type( nEnum, nHandle )); + m_aMapEnumToPropHandle.emplace( nEnum, nHandle ); } } -- cgit v1.2.3