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 /accessibility | |
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 'accessibility')
-rw-r--r-- | accessibility/source/extended/accessiblelistbox.cxx | 4 | ||||
-rw-r--r-- | accessibility/source/helper/characterattributeshelper.cxx | 26 | ||||
-rw-r--r-- | accessibility/source/standard/vclxaccessibletoolbox.cxx | 2 |
3 files changed, 16 insertions, 16 deletions
diff --git a/accessibility/source/extended/accessiblelistbox.cxx b/accessibility/source/extended/accessiblelistbox.cxx index 8c5765835bb7..47c8f9ecd3a5 100644 --- a/accessibility/source/extended/accessiblelistbox.cxx +++ b/accessibility/source/extended/accessiblelistbox.cxx @@ -147,7 +147,7 @@ namespace accessibility { AccessibleListBoxEntry *pEntNew = new AccessibleListBoxEntry( *getListBox(), pEntry, nullptr ); m_xFocusedChild = pEntNew; - m_mapEntry.insert(MAP_ENTRY::value_type(pEntry,pEntNew)); + m_mapEntry.emplace(pEntry,pEntNew); } aNewValue <<= m_xFocusedChild; @@ -232,7 +232,7 @@ namespace accessibility else { pAccCurOptionEntry =new AccessibleListBoxEntry( *getListBox(), pEntry, nullptr ); - std::pair<MAP_ENTRY::iterator, bool> pairMi = m_mapEntry.insert(MAP_ENTRY::value_type(pAccCurOptionEntry->GetSvLBoxEntry(),pAccCurOptionEntry)); + std::pair<MAP_ENTRY::iterator, bool> pairMi = m_mapEntry.emplace(pAccCurOptionEntry->GetSvLBoxEntry(), pAccCurOptionEntry); mi = pairMi.first; } diff --git a/accessibility/source/helper/characterattributeshelper.cxx b/accessibility/source/helper/characterattributeshelper.cxx index 7a88351c91a2..302ee29145b4 100644 --- a/accessibility/source/helper/characterattributeshelper.cxx +++ b/accessibility/source/helper/characterattributeshelper.cxx @@ -27,19 +27,19 @@ using namespace ::com::sun::star::beans; CharacterAttributesHelper::CharacterAttributesHelper( const vcl::Font& rFont, sal_Int32 nBackColor, sal_Int32 nColor ) { - m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharBackColor" ), Any( nBackColor ) ) ); - m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharColor" ), Any( nColor ) ) ); - m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontCharSet" ), Any( (sal_Int16) rFont.GetCharSet() ) ) ); - m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontFamily" ), Any( (sal_Int16) rFont.GetFamilyType() ) ) ); - m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontName" ), Any( rFont.GetFamilyName() ) ) ); - m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontPitch" ), Any( (sal_Int16) rFont.GetPitch() ) ) ); - m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharFontStyleName" ), Any( rFont.GetStyleName() ) ) ); - m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharHeight" ), Any( (sal_Int16) rFont.GetFontSize().Height() ) ) ); - m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharScaleWidth" ), Any( (sal_Int16) rFont.GetFontSize().Width() ) ) ); - m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharStrikeout" ), Any( (sal_Int16) rFont.GetStrikeout() ) ) ); - m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharUnderline" ), Any( (sal_Int16) rFont.GetUnderline() ) ) ); - m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharWeight" ), Any( (float) rFont.GetWeight() ) ) ); - m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharPosture" ), Any( (sal_Int16)rFont.GetItalic() ) ) ); + m_aAttributeMap.emplace( OUString( "CharBackColor" ), Any( nBackColor ) ); + m_aAttributeMap.emplace( OUString( "CharColor" ), Any( nColor ) ); + m_aAttributeMap.emplace( OUString( "CharFontCharSet" ), Any( (sal_Int16) rFont.GetCharSet() ) ); + m_aAttributeMap.emplace( OUString( "CharFontFamily" ), Any( (sal_Int16) rFont.GetFamilyType() ) ); + m_aAttributeMap.emplace( OUString( "CharFontName" ), Any( rFont.GetFamilyName() ) ); + m_aAttributeMap.emplace( OUString( "CharFontPitch" ), Any( (sal_Int16) rFont.GetPitch() ) ); + m_aAttributeMap.emplace( OUString( "CharFontStyleName" ), Any( rFont.GetStyleName() ) ); + m_aAttributeMap.emplace( OUString( "CharHeight" ), Any( (sal_Int16) rFont.GetFontSize().Height() ) ); + m_aAttributeMap.emplace( OUString( "CharScaleWidth" ), Any( (sal_Int16) rFont.GetFontSize().Width() ) ); + m_aAttributeMap.emplace( OUString( "CharStrikeout" ), Any( (sal_Int16) rFont.GetStrikeout() ) ); + m_aAttributeMap.emplace( OUString( "CharUnderline" ), Any( (sal_Int16) rFont.GetUnderline() ) ); + m_aAttributeMap.emplace( OUString( "CharWeight" ), Any( (float) rFont.GetWeight() ) ); + m_aAttributeMap.emplace( OUString( "CharPosture" ), Any( (sal_Int16)rFont.GetItalic() ) ); } diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx index 3bbd139ed9fb..0dd0134a54d5 100644 --- a/accessibility/source/standard/vclxaccessibletoolbox.cxx +++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx @@ -738,7 +738,7 @@ Reference< XAccessible > SAL_CALL VCLXAccessibleToolBox::getAccessibleChild( sal pChild->SetChecked( true ); if ( pToolBox->GetItemState( nItemId ) == TRISTATE_INDET ) pChild->SetIndeterminate( true ); - m_aAccessibleChildren.insert( ToolBoxItemsMap::value_type( i, xChild ) ); + m_aAccessibleChildren.emplace( i, xChild ); } else { |