From db17a874af37350b3270932175854ee674447bc1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 11 Aug 2017 11:36:47 +0200 Subject: convert std::map::insert to std::map::emplace II Change-Id: Ief8bd59c903625ba65b75114b7b52c3b7ecbd331 Reviewed-on: https://gerrit.libreoffice.org/41019 Tested-by: Jenkins Reviewed-by: Noel Grandin --- .../source/chart/SchXMLPropertyMappingContext.cxx | 5 ++--- xmloff/source/chart/SchXMLSeries2Context.cxx | 24 ++++++++-------------- xmloff/source/chart/SchXMLTools.cxx | 5 ++--- xmloff/source/core/nmspmap.cxx | 4 +--- xmloff/source/style/xmlexppr.cxx | 2 +- 5 files changed, 15 insertions(+), 25 deletions(-) (limited to 'xmloff/source') diff --git a/xmloff/source/chart/SchXMLPropertyMappingContext.cxx b/xmloff/source/chart/SchXMLPropertyMappingContext.cxx index 28074eedd8e1..ff739ae7f6ee 100644 --- a/xmloff/source/chart/SchXMLPropertyMappingContext.cxx +++ b/xmloff/source/chart/SchXMLPropertyMappingContext.cxx @@ -109,10 +109,9 @@ void SchXMLPropertyMappingContext::StartElement(const uno::Reference< xml::sax:: Reference< chart2::XChartDocument > xChartDoc( GetImport().GetModel(), uno::UNO_QUERY ); Reference< chart2::data::XLabeledDataSequence2 > xSeq = createAndAddSequenceToSeries(aRole, aRange, xChartDoc, mxDataSeries); - mrLSequencesPerIndex.insert( - tSchXMLLSequencesPerIndex::value_type( + mrLSequencesPerIndex.emplace( tSchXMLIndexWithPart( 0, SCH_XML_PART_VALUES), - Reference< chart2::data::XLabeledDataSequence >( xSeq, UNO_QUERY ))); + Reference< chart2::data::XLabeledDataSequence >( xSeq, UNO_QUERY )); } } diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx index d868cf61ae13..a40d23c3a6a5 100644 --- a/xmloff/source/chart/SchXMLSeries2Context.cxx +++ b/xmloff/source/chart/SchXMLSeries2Context.cxx @@ -185,9 +185,8 @@ void lcl_insertErrorBarLSequencesToMap( for( sal_Int32 nIndex = 0; nIndex < aLSequences.getLength(); ++nIndex ) { // use "0" as data index. This is ok, as it is not used for error bars - rInOutMap.insert( - tSchXMLLSequencesPerIndex::value_type( - tSchXMLIndexWithPart( 0, SCH_XML_PART_ERROR_BARS ), aLSequences[ nIndex ] )); + rInOutMap.emplace( + tSchXMLIndexWithPart( 0, SCH_XML_PART_ERROR_BARS ), aLSequences[ nIndex ] ); } } } @@ -434,9 +433,8 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib xLabeledSeq->setValues(xSequenceValues); // register for setting local data if external data provider is not present - maPostponedSequences.insert( - tSchXMLLSequencesPerIndex::value_type( - tSchXMLIndexWithPart( m_rGlobalSeriesImportInfo.nCurrentDataIndex, SCH_XML_PART_VALUES ), xLabeledSeq )); + maPostponedSequences.emplace( + tSchXMLIndexWithPart( m_rGlobalSeriesImportInfo.nCurrentDataIndex, SCH_XML_PART_VALUES ), xLabeledSeq ); // label Reference xSequenceLabel; @@ -462,9 +460,8 @@ void SchXMLSeries2Context::StartElement( const uno::Reference< xml::sax::XAttrib // for creation, because internal data always has labels. If // they don't exist in the original, auto-generated labels are // used for the internal data. - maPostponedSequences.insert( - tSchXMLLSequencesPerIndex::value_type( - tSchXMLIndexWithPart( m_rGlobalSeriesImportInfo.nCurrentDataIndex, SCH_XML_PART_LABEL ), xLabeledSeq )); + maPostponedSequences.emplace( + tSchXMLIndexWithPart( m_rGlobalSeriesImportInfo.nCurrentDataIndex, SCH_XML_PART_LABEL ), xLabeledSeq ); Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeq( &xLabeledSeq, 1 ); Reference< chart2::data::XDataSink > xSink( m_xSeries, uno::UNO_QUERY_THROW ); @@ -619,10 +616,9 @@ void SchXMLSeries2Context::EndElement() if( xLabeledSeq.is() ) { // register for setting local data if external data provider is not present - mrLSequencesPerIndex.insert( - tSchXMLLSequencesPerIndex::value_type( + mrLSequencesPerIndex.emplace( tSchXMLIndexWithPart( aDomainInfo.nIndexForLocalData, SCH_XML_PART_VALUES ), - Reference< chart2::data::XLabeledDataSequence >(xLabeledSeq, uno::UNO_QUERY_THROW) )); + Reference< chart2::data::XLabeledDataSequence >(xLabeledSeq, uno::UNO_QUERY_THROW) ); } } @@ -632,9 +628,7 @@ void SchXMLSeries2Context::EndElement() aIt != maPostponedSequences.end(); ++aIt ) { sal_Int32 nNewIndex = aIt->first.first + nDomainCount; - mrLSequencesPerIndex.insert( - tSchXMLLSequencesPerIndex::value_type( - tSchXMLIndexWithPart( nNewIndex, aIt->first.second ), aIt->second )); + mrLSequencesPerIndex.emplace( tSchXMLIndexWithPart( nNewIndex, aIt->first.second ), aIt->second ); } m_rGlobalSeriesImportInfo.nCurrentDataIndex++; } diff --git a/xmloff/source/chart/SchXMLTools.cxx b/xmloff/source/chart/SchXMLTools.cxx index 13ef728160d2..6d3dc3e99081 100644 --- a/xmloff/source/chart/SchXMLTools.cxx +++ b/xmloff/source/chart/SchXMLTools.cxx @@ -513,9 +513,8 @@ void CreateCategories( if( pLSequencesPerIndex ) { // register for setting local data if external data provider is not present - pLSequencesPerIndex->insert( - tSchXMLLSequencesPerIndex::value_type( - tSchXMLIndexWithPart( SCH_XML_CATEGORIES_INDEX, SCH_XML_PART_VALUES ), xLabeledSeq )); + pLSequencesPerIndex->emplace( + tSchXMLIndexWithPart( SCH_XML_CATEGORIES_INDEX, SCH_XML_PART_VALUES ), xLabeledSeq ); } xAxis->setScaleData( aData ); } diff --git a/xmloff/source/core/nmspmap.cxx b/xmloff/source/core/nmspmap.cxx index 52cfb2add085..47d6e07ebec4 100644 --- a/xmloff/source/core/nmspmap.cxx +++ b/xmloff/source/core/nmspmap.cxx @@ -252,9 +252,7 @@ OUString SvXMLNamespaceMap::GetQNameByKey( sal_uInt16 nKey, if (bCache) { OUString sString(sQName.makeStringAndClear()); - aQNameCache.insert( - QNameCache::value_type( - QNamePair(nKey, rLocalName), sString)); + aQNameCache.emplace(QNamePair(nKey, rLocalName), sString); return sString; } else diff --git a/xmloff/source/style/xmlexppr.cxx b/xmloff/source/style/xmlexppr.cxx index d11b5ed37fef..d2fd6834811f 100644 --- a/xmloff/source/style/xmlexppr.cxx +++ b/xmloff/source/style/xmlexppr.cxx @@ -623,7 +623,7 @@ vector SvXMLExportPropertyMapper::Filter_( xInfo = xWeakInfo; if( xInfo.is() ) { - mpImpl->maCache.insert(Impl::CacheType::value_type(xInfo, pFilterInfo)); + mpImpl->maCache.emplace(xInfo, pFilterInfo); } else bDelInfo = true; -- cgit v1.2.3