summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-06-03 15:16:19 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-06-04 06:35:44 +0000
commit81610561edfb8c899a062cc09fc1a80e8098577f (patch)
treecdb746528f25a7d40c51be4b9cd324ceb55035b6 /chart2
parenta9a2375a744368415a7ea4c563c8e4776a6ec059 (diff)
uno::Sequence provides now begin and end
use begin() and end() when calling std::copy on an uno::Sequence Inspired by commit b34b648fc3262c5d9aa295f621e8fe9c97d4c6b2 "uno::Sequence provides now begin and end" Change-Id: I08e8c3fd6144e77b95a26f85bc0daf6a9edeeb0b Reviewed-on: https://gerrit.libreoffice.org/16057 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/dialogs/DialogModel.cxx2
-rw-r--r--chart2/source/inc/ContainerHelper.hxx5
-rw-r--r--chart2/source/model/template/ChartTypeTemplate.cxx4
-rw-r--r--chart2/source/model/template/ColumnLineChartTypeTemplate.cxx8
-rw-r--r--chart2/source/model/template/ColumnLineDataInterpreter.cxx4
-rw-r--r--chart2/source/tools/DataSeriesHelper.cxx2
-rw-r--r--chart2/source/tools/DataSourceHelper.cxx4
-rw-r--r--chart2/source/tools/DiagramHelper.cxx7
8 files changed, 17 insertions, 19 deletions
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx
index f8ea3f7782e7..6127ee9cb6d9 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -522,7 +522,7 @@ DialogModel::tRolesWithRanges DialogModel::getRolesWithRanges(
{
Reference< data::XDataSource > xSource( xSeries, uno::UNO_QUERY_THROW );
const Sequence< Reference< data::XLabeledDataSequence > > aSeq( xSource->getDataSequences());
- ::std::copy( aSeq.getConstArray(), aSeq.getConstArray() + aSeq.getLength(),
+ ::std::copy( aSeq.begin(), aSeq.end(),
lcl_RolesWithRangeAppend( &aResult, aRoleOfSequenceForLabel ));
if( xChartType.is())
{
diff --git a/chart2/source/inc/ContainerHelper.hxx b/chart2/source/inc/ContainerHelper.hxx
index 139ddd6fd667..d6eee1a9aa61 100644
--- a/chart2/source/inc/ContainerHelper.hxx
+++ b/chart2/source/inc/ContainerHelper.hxx
@@ -69,8 +69,7 @@ template< class Container >
SequenceToSTLSequenceContainer( const ::com::sun::star::uno::Sequence< typename Container::value_type > & rSeq )
{
Container aResult( rSeq.getLength());
- ::std::copy( rSeq.getConstArray(), rSeq.getConstArray() + rSeq.getLength(),
- aResult.begin() );
+ ::std::copy( rSeq.begin(), rSeq.end(), aResult.begin() );
return aResult;
}
@@ -95,7 +94,7 @@ template< class Container >
SequenceToSTLContainer( const ::com::sun::star::uno::Sequence< typename Container::value_type > & rSeq )
{
Container aResult;
- ::std::copy( rSeq.getConstArray(), rSeq.getConstArray() + rSeq.getLength(),
+ ::std::copy( rSeq.begin(), rSeq.end(),
::std::inserter< Container >( aResult, aResult.begin()));
return aResult;
}
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index 0e57e62de90d..f42adadc51cd 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -854,8 +854,8 @@ void ChartTypeTemplate::createChartTypes(
Sequence< Reference< XDataSeries > > aNewSeriesSeq( xDSCnt->getDataSeries());
sal_Int32 nNewStartIndex = aNewSeriesSeq.getLength();
aNewSeriesSeq.realloc( nNewStartIndex + aSeriesSeq[nSeriesIdx].getLength() );
- ::std::copy( aSeriesSeq[nSeriesIdx].getConstArray(),
- aSeriesSeq[nSeriesIdx].getConstArray() + aSeriesSeq[nSeriesIdx].getLength(),
+ ::std::copy( aSeriesSeq[nSeriesIdx].begin(),
+ aSeriesSeq[nSeriesIdx].end(),
aNewSeriesSeq.getArray() + nNewStartIndex );
xDSCnt->setDataSeries( aNewSeriesSeq );
}
diff --git a/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx b/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
index e44a97ef010d..8e741fb6dee8 100644
--- a/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ColumnLineChartTypeTemplate.cxx
@@ -214,8 +214,8 @@ void ColumnLineChartTypeTemplate::createChartTypes(
{
Reference< XDataSeriesContainer > xDSCnt( xCT, uno::UNO_QUERY_THROW );
Sequence< Reference< XDataSeries > > aColumnSeq( nNumberOfColumns );
- ::std::copy( aFlatSeriesSeq.getConstArray(),
- aFlatSeriesSeq.getConstArray() + nNumberOfColumns,
+ ::std::copy( aFlatSeriesSeq.begin(),
+ aFlatSeriesSeq.begin() + nNumberOfColumns,
aColumnSeq.getArray());
xDSCnt->setDataSeries( aColumnSeq );
}
@@ -230,8 +230,8 @@ void ColumnLineChartTypeTemplate::createChartTypes(
{
Reference< XDataSeriesContainer > xDSCnt( xCT, uno::UNO_QUERY_THROW );
Sequence< Reference< XDataSeries > > aLineSeq( nNumberOfLines );
- ::std::copy( aFlatSeriesSeq.getConstArray() + nNumberOfColumns,
- aFlatSeriesSeq.getConstArray() + aFlatSeriesSeq.getLength(),
+ ::std::copy( aFlatSeriesSeq.begin() + nNumberOfColumns,
+ aFlatSeriesSeq.end(),
aLineSeq.getArray());
xDSCnt->setDataSeries( aLineSeq );
}
diff --git a/chart2/source/model/template/ColumnLineDataInterpreter.cxx b/chart2/source/model/template/ColumnLineDataInterpreter.cxx
index 8202d8e5a796..aba77b13ca36 100644
--- a/chart2/source/model/template/ColumnLineDataInterpreter.cxx
+++ b/chart2/source/model/template/ColumnLineDataInterpreter.cxx
@@ -74,8 +74,8 @@ InterpretedData SAL_CALL ColumnLineDataInterpreter::interpretDataSource(
Sequence< Reference< XDataSeries > > & rColumnDataSeries = aResult.Series[0];
Sequence< Reference< XDataSeries > > & rLineDataSeries = aResult.Series[1];
rLineDataSeries.realloc( nNumOfLines );
- ::std::copy( rColumnDataSeries.getConstArray() + nNumberOfSeries - nNumOfLines,
- rColumnDataSeries.getConstArray() + nNumberOfSeries,
+ ::std::copy( rColumnDataSeries.begin() + nNumberOfSeries - nNumOfLines,
+ rColumnDataSeries.begin() + nNumberOfSeries,
rLineDataSeries.getArray() );
rColumnDataSeries.realloc( nNumberOfSeries - nNumOfLines );
}
diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx
index 44debefa9255..43291616b047 100644
--- a/chart2/source/tools/DataSeriesHelper.cxx
+++ b/chart2/source/tools/DataSeriesHelper.cxx
@@ -248,7 +248,7 @@ getAllDataSequences( const uno::Sequence<uno::Reference<chart2::XDataSeries> >&
if( xSource.is())
{
Sequence< Reference< chart2::data::XLabeledDataSequence > > aSeq( xSource->getDataSequences());
- ::std::copy( aSeq.getConstArray(), aSeq.getConstArray() + aSeq.getLength(),
+ ::std::copy( aSeq.begin(), aSeq.end(),
::std::back_inserter( aSeqVec ));
}
}
diff --git a/chart2/source/tools/DataSourceHelper.cxx b/chart2/source/tools/DataSourceHelper.cxx
index fea62683c3d9..0afe27e51ab7 100644
--- a/chart2/source/tools/DataSourceHelper.cxx
+++ b/chart2/source/tools/DataSourceHelper.cxx
@@ -320,7 +320,7 @@ uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData(
if( !xDataSource.is() )
continue;
uno::Sequence< uno::Reference< data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() );
- ::std::copy( aDataSequences.getConstArray(), aDataSequences.getConstArray() + aDataSequences.getLength(),
+ ::std::copy( aDataSequences.begin(), aDataSequences.end(),
::std::back_inserter( aResult ));
}
@@ -346,7 +346,7 @@ uno::Reference< chart2::data::XDataSource > DataSourceHelper::getUsedData(
if( !xDataSource.is() )
continue;
uno::Sequence< uno::Reference< data::XLabeledDataSequence > > aDataSequences( xDataSource->getDataSequences() );
- ::std::copy( aDataSequences.getConstArray(), aDataSequences.getConstArray() + aDataSequences.getLength(),
+ ::std::copy( aDataSequences.begin(), aDataSequences.end(),
::std::back_inserter( aResult ));
}
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index 82dca03fcd16..8023956f936d 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -714,7 +714,7 @@ uno::Reference< XChartType > DiagramHelper::getChartTypeOfSeries(
{
Reference< XDataSeriesContainer > xDSCnt( aChartTypeSeq[j], uno::UNO_QUERY_THROW );
Sequence< Reference< XDataSeries > > aSeriesSeq( xDSCnt->getDataSeries() );
- ::std::copy( aSeriesSeq.getConstArray(), aSeriesSeq.getConstArray() + aSeriesSeq.getLength(),
+ ::std::copy( aSeriesSeq.begin(), aSeriesSeq.end(),
::std::back_inserter( aResult ));
}
}
@@ -1226,9 +1226,8 @@ Sequence< Reference< XChartType > >
{
Reference< XChartTypeContainer > xCTCnt( aCooSysSeq[i], uno::UNO_QUERY_THROW );
Sequence< Reference< XChartType > > aChartTypeSeq( xCTCnt->getChartTypes());
- ::std::copy( aChartTypeSeq.getConstArray(),
- aChartTypeSeq.getConstArray() + aChartTypeSeq.getLength(),
- ::std::back_inserter( aResult ));
+ ::std::copy( aChartTypeSeq.begin(), aChartTypeSeq.end(),
+ ::std::back_inserter( aResult ));
}
}
catch( const uno::Exception & ex )