summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-08-10 16:43:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-08-11 12:38:32 +0200
commitd347c2403605c5aa3ddd98fb605366914acab79f (patch)
treee39624030741234c514bccd858e69d6318dfba68 /xmloff
parentf0e68d4feaaa43f7450432ad1ebd92c2b572400f (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 'xmloff')
-rw-r--r--xmloff/source/chart/SchXMLPlotAreaContext.cxx3
-rw-r--r--xmloff/source/chart/SchXMLTableContext.cxx18
-rw-r--r--xmloff/source/core/i18nmap.cxx2
-rw-r--r--xmloff/source/core/nmspmap.cxx2
-rw-r--r--xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx2
-rw-r--r--xmloff/source/forms/layerexport.cxx2
-rw-r--r--xmloff/source/forms/layerimport.cxx3
-rw-r--r--xmloff/source/forms/property_meta_data.cxx2
-rw-r--r--xmloff/source/style/SinglePropertySetInfoCache.cxx2
9 files changed, 14 insertions, 22 deletions
diff --git a/xmloff/source/chart/SchXMLPlotAreaContext.cxx b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
index 03ee2ecf1d84..bed146edf7b6 100644
--- a/xmloff/source/chart/SchXMLPlotAreaContext.cxx
+++ b/xmloff/source/chart/SchXMLPlotAreaContext.cxx
@@ -901,8 +901,7 @@ static void lcl_setErrorBarSequence ( const uno::Reference< chart2::XChartDocume
Reference< chart2::data::XLabeledDataSequence > xLabelSeq( chart2::data::LabeledDataSequence::create(xContext),
uno::UNO_QUERY_THROW );
- rSequences.insert( tSchXMLLSequencesPerIndex::value_type(
- tSchXMLIndexWithPart( -2, SCH_XML_PART_ERROR_BARS ), xLabelSeq ) );
+ rSequences.emplace( tSchXMLIndexWithPart( -2, SCH_XML_PART_ERROR_BARS ), xLabelSeq );
xLabelSeq->setValues( xNewSequence );
diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx
index 32c7ee0ecad4..f68f4b27c873 100644
--- a/xmloff/source/chart/SchXMLTableContext.cxx
+++ b/xmloff/source/chart/SchXMLTableContext.cxx
@@ -125,18 +125,15 @@ void lcl_fillRangeMapping(
if( nCol == 0 && rTable.bHasHeaderColumn )
{
SAL_WARN_IF( static_cast< sal_Int32 >( nRow ) != nRowOffset, "xmloff.chart", "nRow != nRowOffset" );
- rOutRangeMap.insert( lcl_tOriginalRangeToInternalRangeMap::value_type(
- aRangeId, lcl_aCategoriesRange ));
+ rOutRangeMap.emplace(aRangeId, lcl_aCategoriesRange);
}
else
{
OUString aColNumStr = OUString::number( nCol - nColOffset);
if( nRow == 0 && rTable.bHasHeaderRow )
- rOutRangeMap.insert( lcl_tOriginalRangeToInternalRangeMap::value_type(
- aRangeId, lcl_aLabelPrefix + aColNumStr ));
+ rOutRangeMap.emplace( aRangeId, lcl_aLabelPrefix + aColNumStr );
else
- rOutRangeMap.insert( lcl_tOriginalRangeToInternalRangeMap::value_type(
- aRangeId, aColNumStr ));
+ rOutRangeMap.emplace( aRangeId, aColNumStr );
}
}
else // eDataRowSource == chart::ChartDataRowSource_ROWS
@@ -144,18 +141,15 @@ void lcl_fillRangeMapping(
if( nRow == 0 && rTable.bHasHeaderRow )
{
SAL_WARN_IF( static_cast< sal_Int32 >( nCol ) != nColOffset, "xmloff.chart", "nCol != nColOffset" );
- rOutRangeMap.insert( lcl_tOriginalRangeToInternalRangeMap::value_type(
- aRangeId, lcl_aCategoriesRange ));
+ rOutRangeMap.emplace( aRangeId, lcl_aCategoriesRange );
}
else
{
OUString aRowNumStr = OUString::number( nRow - nRowOffset);
if( nCol == 0 && rTable.bHasHeaderColumn )
- rOutRangeMap.insert( lcl_tOriginalRangeToInternalRangeMap::value_type(
- aRangeId, lcl_aLabelPrefix + aRowNumStr ));
+ rOutRangeMap.emplace( aRangeId, lcl_aLabelPrefix + aRowNumStr );
else
- rOutRangeMap.insert( lcl_tOriginalRangeToInternalRangeMap::value_type(
- aRangeId, aRowNumStr ));
+ rOutRangeMap.emplace( aRangeId, aRowNumStr );
}
}
}
diff --git a/xmloff/source/core/i18nmap.cxx b/xmloff/source/core/i18nmap.cxx
index 87a7801da048..cc8ad3682bbf 100644
--- a/xmloff/source/core/i18nmap.cxx
+++ b/xmloff/source/core/i18nmap.cxx
@@ -24,7 +24,7 @@ bool SvI18NMap::Add( sal_uInt16 nKind, const OUString& rName,
const OUString& rNewName )
{
SvI18NMapEntry_Key aKey(nKind, rName);
- bool bIsNewInsertion = m_aMap.insert(SvI18NMap_Impl::value_type(aKey, rNewName)).second;
+ bool bIsNewInsertion = m_aMap.emplace(aKey, rNewName).second;
SAL_INFO_IF(!bIsNewInsertion, "xmloff.core", "SvI18NMap::Add: item with key \"" << rName << "\" registered already, likely invalid input file");
return bIsNewInsertion;
}
diff --git a/xmloff/source/core/nmspmap.cxx b/xmloff/source/core/nmspmap.cxx
index 7d45c524d5f5..52cfb2add085 100644
--- a/xmloff/source/core/nmspmap.cxx
+++ b/xmloff/source/core/nmspmap.cxx
@@ -347,7 +347,7 @@ sal_uInt16 SvXMLNamespaceMap::GetKeyByAttrName_( const OUString& rAttrName,
if (bCache)
{
- aNameCache.insert(NameSpaceHash::value_type(rAttrName, xEntry));
+ aNameCache.emplace(rAttrName, xEntry);
}
}
diff --git a/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx b/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx
index 40ca17543de1..795aa5838218 100644
--- a/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx
+++ b/xmloff/source/core/unointerfacetouniqueidentifiermapper.cxx
@@ -46,7 +46,7 @@ const OUString& UnoInterfaceToUniqueIdentifierMapper::registerReference( const R
{
OUString aId( "id" );
aId += OUString::number( mnNextId++ );
- return (*maEntries.insert( IdMap_t::value_type( aId, xRef ) ).first).first;
+ return (*maEntries.emplace( aId, xRef ).first).first;
}
}
diff --git a/xmloff/source/forms/layerexport.cxx b/xmloff/source/forms/layerexport.cxx
index aea4f1206521..455940c553aa 100644
--- a/xmloff/source/forms/layerexport.cxx
+++ b/xmloff/source/forms/layerexport.cxx
@@ -605,7 +605,7 @@ namespace xmloff
OSL_ENSURE( m_aGridColumnStyles.end() == m_aGridColumnStyles.find( xColumnProperties ),
"OFormLayerXMLExport_Impl::collectGridColumnStylesAndIds: already have a style for this column!" );
- m_aGridColumnStyles.insert( MapPropertySet2String::value_type( xColumnProperties, sColumnStyleName ) );
+ m_aGridColumnStyles.emplace( xColumnProperties, sColumnStyleName );
}
}
}
diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx
index dd1deeb76dfb..f11584c0762f 100644
--- a/xmloff/source/forms/layerimport.cxx
+++ b/xmloff/source/forms/layerimport.cxx
@@ -382,8 +382,7 @@ void OFormLayerXMLImport_Impl::startPage(const Reference< XDrawPage >& _rxDrawPa
// add a new entry to our page map
::std::pair< MapDrawPage2Map::iterator, bool > aPagePosition;
- aPagePosition =
- m_aControlIds.insert(MapDrawPage2Map::value_type(_rxDrawPage, MapString2PropertySet()));
+ aPagePosition = m_aControlIds.emplace(_rxDrawPage, MapString2PropertySet());
OSL_ENSURE(aPagePosition.second, "OFormLayerXMLImport_Impl::startPage: already imported this page!");
m_aCurrentPageIds = aPagePosition.first;
}
diff --git a/xmloff/source/forms/property_meta_data.cxx b/xmloff/source/forms/property_meta_data.cxx
index 3a8c8dabea28..7da6f4974bec 100644
--- a/xmloff/source/forms/property_meta_data.cxx
+++ b/xmloff/source/forms/property_meta_data.cxx
@@ -143,7 +143,7 @@ namespace xmloff { namespace metadata
while ( !desc->propertyName.isEmpty() )
{
if ( desc->propertyGroup != NO_GROUP )
- s_attributeGroups.insert( AttributeGroups::value_type( desc->attribute, desc->propertyGroup ) );
+ s_attributeGroups.emplace( desc->attribute, desc->propertyGroup );
++desc;
}
}
diff --git a/xmloff/source/style/SinglePropertySetInfoCache.cxx b/xmloff/source/style/SinglePropertySetInfoCache.cxx
index e1ca7281ee29..ee0e890f112c 100644
--- a/xmloff/source/style/SinglePropertySetInfoCache.cxx
+++ b/xmloff/source/style/SinglePropertySetInfoCache.cxx
@@ -45,7 +45,7 @@ bool SinglePropertySetInfoCache::hasProperty(
rPropSetInfo = xWeakInfo;
if( rPropSetInfo.is() )
{
- map_.insert(Map::value_type(rPropSetInfo, bRet));
+ map_.emplace(rPropSetInfo, bRet);
}
return bRet;
}