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 /framework/source/fwe | |
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 'framework/source/fwe')
4 files changed, 9 insertions, 9 deletions
diff --git a/framework/source/fwe/classes/addonsoptions.cxx b/framework/source/fwe/classes/addonsoptions.cxx index 3e9bf8a23a07..89a037799942 100644 --- a/framework/source/fwe/classes/addonsoptions.cxx +++ b/framework/source/fwe/classes/addonsoptions.cxx @@ -644,7 +644,7 @@ void AddonsOptions_Impl::ReadOfficeMenuBarSet( Sequence< Sequence< PropertyValue sal_uInt32 nMenuItemCount = rAddonOfficeMenuBarSeq.getLength() + 1; rAddonOfficeMenuBarSeq.realloc( nMenuItemCount ); rAddonOfficeMenuBarSeq[nIndex] = aPopupMenu; - aTitleToIndexMap.insert( StringToIndexMap::value_type( aPopupTitle, nIndex )); + aTitleToIndexMap.emplace( aPopupTitle, nIndex ); ++nIndex; } } @@ -746,7 +746,7 @@ void AddonsOptions_Impl::ReadImages( ImageManager& aImageManager ) if ( pImageEntry ) { // Successfully read a user-defined images item, put it into our image manager - aImageManager.insert( ImageManager::value_type( aURL, *pImageEntry )); + aImageManager.emplace( aURL, *pImageEntry ); delete pImageEntry; // We have the ownership of the pointer } } @@ -1321,7 +1321,7 @@ void AddonsOptions_Impl::ReadAndAssociateImages( const OUString& aURL, const OUS Image(), aFileURL.makeStringAndClear() ); } - m_aImageManager.insert( ImageManager::value_type( aURL, aImageEntry )); + m_aImageManager.emplace( aURL, aImageEntry ); } AddonsOptions_Impl::ImageEntry* AddonsOptions_Impl::ReadImageData( const OUString& aImagesNodeName ) diff --git a/framework/source/fwe/xml/statusbardocumenthandler.cxx b/framework/source/fwe/xml/statusbardocumenthandler.cxx index d1edc94bb6d8..b50ae541474f 100644 --- a/framework/source/fwe/xml/statusbardocumenthandler.cxx +++ b/framework/source/fwe/xml/statusbardocumenthandler.cxx @@ -155,14 +155,14 @@ OReadStatusBarDocumentHandler::OReadStatusBarDocumentHandler( OUString temp( XMLNS_STATUSBAR ); temp += XMLNS_FILTER_SEPARATOR; temp += OUString::createFromAscii( StatusBarEntries[i].aEntryName ); - m_aStatusBarMap.insert( StatusBarHashMap::value_type( temp, (StatusBar_XML_Entry)i ) ); + m_aStatusBarMap.emplace( temp, (StatusBar_XML_Entry)i ); } else { OUString temp( XMLNS_XLINK ); temp += XMLNS_FILTER_SEPARATOR; temp += OUString::createFromAscii( StatusBarEntries[i].aEntryName ); - m_aStatusBarMap.insert( StatusBarHashMap::value_type( temp, (StatusBar_XML_Entry)i ) ); + m_aStatusBarMap.emplace( temp, (StatusBar_XML_Entry)i ); } } diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx b/framework/source/fwe/xml/toolboxdocumenthandler.cxx index 50fc7dfe4ad2..eb59a9faacbc 100644 --- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx +++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx @@ -135,14 +135,14 @@ OReadToolBoxDocumentHandler::OReadToolBoxDocumentHandler( const Reference< XInde OUString temp( XMLNS_TOOLBAR ); temp += XMLNS_FILTER_SEPARATOR; temp += OUString::createFromAscii( ToolBoxEntries[i].aEntryName ); - m_aToolBoxMap.insert( ToolBoxHashMap::value_type( temp, (ToolBox_XML_Entry)i ) ); + m_aToolBoxMap.emplace( temp, (ToolBox_XML_Entry)i ); } else { OUString temp( XMLNS_XLINK ); temp += XMLNS_FILTER_SEPARATOR; temp += OUString::createFromAscii( ToolBoxEntries[i].aEntryName ); - m_aToolBoxMap.insert( ToolBoxHashMap::value_type( temp, (ToolBox_XML_Entry)i ) ); + m_aToolBoxMap.emplace( temp, (ToolBox_XML_Entry)i ); } } diff --git a/framework/source/fwe/xml/xmlnamespaces.cxx b/framework/source/fwe/xml/xmlnamespaces.cxx index 6909508f78a5..c13c0bbbf163 100644 --- a/framework/source/fwe/xml/xmlnamespaces.cxx +++ b/framework/source/fwe/xml/xmlnamespaces.cxx @@ -81,11 +81,11 @@ void XMLNamespaces::addNamespace( const OUString& aName, const OUString& aValue { // replace current namespace definition m_aNamespaceMap.erase( p ); - m_aNamespaceMap.insert( NamespaceMap::value_type( aNamespaceName, aValue )); + m_aNamespaceMap.emplace( aNamespaceName, aValue ); } else { - m_aNamespaceMap.insert( NamespaceMap::value_type( aNamespaceName, aValue )); + m_aNamespaceMap.emplace( aNamespaceName, aValue ); } } } |