summaryrefslogtreecommitdiff
path: root/chart2/source/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-06-23 15:02:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-06-24 08:43:55 +0200
commita2fc883173d7053cefe543620982051ae40c4b03 (patch)
treedac1b760925c8151dfd8a9cbe3a8735b68ab9f79 /chart2/source/tools
parent010713e65ccade7b682c219707c8db3d864145c1 (diff)
use more std::container::insert instead of std::copy
which is both more compact code, and more efficient, since the insert method can do smarter resizing Change-Id: I17f226660f87cdf002edccc29b4af8fd59a25f91 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96948 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/tools')
-rw-r--r--chart2/source/tools/DataSeriesHelper.cxx3
-rw-r--r--chart2/source/tools/DataSourceHelper.cxx6
-rw-r--r--chart2/source/tools/DiagramHelper.cxx6
-rw-r--r--chart2/source/tools/ImplOPropertySet.cxx3
-rw-r--r--chart2/source/tools/InternalDataProvider.cxx4
5 files changed, 7 insertions, 15 deletions
diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx
index c90a356bf2ee..11f6bf2d94b3 100644
--- a/chart2/source/tools/DataSeriesHelper.cxx
+++ b/chart2/source/tools/DataSeriesHelper.cxx
@@ -244,8 +244,7 @@ getAllDataSequences( const uno::Sequence<uno::Reference<chart2::XDataSeries> >&
if( xSource.is())
{
Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeq( xSource->getDataSequences());
- std::copy( aSeq.begin(), aSeq.end(),
- std::back_inserter( aSeqVec ));
+ aSeqVec.insert( aSeqVec.end(), aSeq.begin(), aSeq.end() );
}
}
diff --git a/chart2/source/tools/DataSourceHelper.cxx b/chart2/source/tools/DataSourceHelper.cxx
index 50fd37347f09..cb74e60eaa54 100644
--- a/chart2/source/tools/DataSourceHelper.cxx
+++ b/chart2/source/tools/DataSourceHelper.cxx
@@ -310,8 +310,7 @@ uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData(
if( !xDataSource.is() )
continue;
uno::Sequence< uno::Reference< data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() );
- std::copy( aDataSequences.begin(), aDataSequences.end(),
- std::back_inserter( aResult ));
+ aResult.insert( aResult.end(), aDataSequences.begin(), aDataSequences.end() );
}
return uno::Reference< chart2::data::XDataSource >(
@@ -335,8 +334,7 @@ uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData(
if( !xDataSource.is() )
continue;
uno::Sequence< uno::Reference< data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() );
- std::copy( aDataSequences.begin(), aDataSequences.end(),
- std::back_inserter( aResult ));
+ aResult.insert( aResult.end(), aDataSequences.begin(), aDataSequences.end() );
}
return uno::Reference< chart2::data::XDataSource >(
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index 213d1787d1ce..5805f929aebb 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -670,8 +670,7 @@ std::vector< Reference< XDataSeries > >
{
Reference< XDataSeriesContainer > xDSCnt( chartType, uno::UNO_QUERY_THROW );
Sequence< Reference< XDataSeries > > aSeriesSeq( xDSCnt->getDataSeries() );
- std::copy( aSeriesSeq.begin(), aSeriesSeq.end(),
- std::back_inserter( aResult ));
+ aResult.insert( aResult.end(), aSeriesSeq.begin(), aSeriesSeq.end() );
}
}
}
@@ -1202,8 +1201,7 @@ Sequence< Reference< XChartType > >
{
Reference< XChartTypeContainer > xCTCnt( coords, uno::UNO_QUERY_THROW );
Sequence< Reference< XChartType > > aChartTypeSeq( xCTCnt->getChartTypes());
- std::copy( aChartTypeSeq.begin(), aChartTypeSeq.end(),
- std::back_inserter( aResult ));
+ aResult.insert( aResult.end(), aChartTypeSeq.begin(), aChartTypeSeq.end() );
}
}
catch( const uno::Exception & )
diff --git a/chart2/source/tools/ImplOPropertySet.cxx b/chart2/source/tools/ImplOPropertySet.cxx
index d5f30096e49e..7d09a329fc33 100644
--- a/chart2/source/tools/ImplOPropertySet.cxx
+++ b/chart2/source/tools/ImplOPropertySet.cxx
@@ -92,8 +92,7 @@ ImplOPropertySet::ImplOPropertySet()
ImplOPropertySet::ImplOPropertySet( const ImplOPropertySet & rOther )
{
- std::copy( rOther.m_aProperties.begin(), rOther.m_aProperties.end(),
- std::inserter( m_aProperties, m_aProperties.begin() ));
+ m_aProperties = rOther.m_aProperties;
// clone interface properties
std::for_each( m_aProperties.begin(), m_aProperties.end(),
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index 7c826e8f6129..ff89bc6dee92 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -456,9 +456,7 @@ void InternalDataProvider::adaptMapReferences(
// erase map values for old index
m_aSequenceMap.erase( aRange.first, aRange.second );
// add new entries for values with new index
- std::copy( aNewElements.begin(), aNewElements.end(),
- std::inserter( m_aSequenceMap,
- m_aSequenceMap.upper_bound( rNewRangeRepresentation )));
+ m_aSequenceMap.insert( aNewElements.begin(), aNewElements.end() );
}
void InternalDataProvider::increaseMapReferences(