summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-20 10:30:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-20 15:41:02 +0200
commitb0f24ca516e13c86d410960788ed6df3efe367b2 (patch)
treecfc27976555434e0166e7fd66f4e6a5becc498d8 /chart2
parent9f958c076a86e80a48fcd7bbca65a834568e94ea (diff)
no need to make copies of the vector here
Change-Id: Ieca07df686668af252800089028146f0f55c26de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133201 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/tools/InternalDataProvider.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index f1e00b786dd1..d8dd648c839f 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -709,7 +709,7 @@ Reference< chart2::data::XDataSource > SAL_CALL InternalDataProvider::createData
{
//return split complex categories if we have any:
std::vector< Reference< chart2::data::XLabeledDataSequence > > aComplexCategories;
- vector< vector< uno::Any > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
+ const vector< vector< uno::Any > > & aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
if( bUseColumns==m_bDataInColumns )
{
sal_Int32 nLevelCount = lcl_getInnerLevelCount( aCategories );
@@ -907,7 +907,7 @@ Sequence< uno::Any > SAL_CALL InternalDataProvider::getDataByRangeRepresentation
else if( aRange.match( lcl_aCategoriesLevelRangeNamePrefix ) )
{
sal_Int32 nLevel = o3tl::toInt32(aRange.subView( strlen(lcl_aCategoriesLevelRangeNamePrefix) ));
- vector< vector< uno::Any > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
+ const vector< vector< uno::Any > > & aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
if( nLevel < lcl_getInnerLevelCount( aCategories ) )
{
aResult.realloc( aCategories.size() );
@@ -917,7 +917,7 @@ Sequence< uno::Any > SAL_CALL InternalDataProvider::getDataByRangeRepresentation
}
else if( aRange == lcl_aCategoriesRangeName )
{
- vector< vector< uno::Any > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
+ const vector< vector< uno::Any > > & aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
sal_Int32 nLevelCount = lcl_getInnerLevelCount( aCategories );
if( nLevelCount == 1 )
{
@@ -1379,7 +1379,7 @@ uno::Sequence< OUString > SplitCategoriesProvider_ForComplexDescriptions::getStr
// ____ XDateCategories ____
Sequence< double > SAL_CALL InternalDataProvider::getDateCategories()
{
- vector< vector< uno::Any > > aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
+ const vector< vector< uno::Any > > & aCategories( m_bDataInColumns ? m_aInternalData.getComplexRowLabels() : m_aInternalData.getComplexColumnLabels());
sal_Int32 nCount = aCategories.size();
Sequence< double > aDoubles( nCount );
auto aDoublesRange = asNonConstRange(aDoubles);
@@ -1478,14 +1478,14 @@ void SAL_CALL InternalDataProvider::setColumnDescriptions( const Sequence< OUStr
Sequence< OUString > SAL_CALL InternalDataProvider::getRowDescriptions()
{
- vector< vector< uno::Any > > aComplexLabels( m_aInternalData.getComplexRowLabels() );
+ const vector< vector< uno::Any > > & aComplexLabels( m_aInternalData.getComplexRowLabels() );
SplitCategoriesProvider_ForComplexDescriptions aProvider( aComplexLabels );
return ExplicitCategoriesProvider::getExplicitSimpleCategories( aProvider );
}
Sequence< OUString > SAL_CALL InternalDataProvider::getColumnDescriptions()
{
- vector< vector< uno::Any > > aComplexLabels( m_aInternalData.getComplexColumnLabels() );
+ const vector< vector< uno::Any > > & aComplexLabels( m_aInternalData.getComplexColumnLabels() );
SplitCategoriesProvider_ForComplexDescriptions aProvider( aComplexLabels );
return ExplicitCategoriesProvider::getExplicitSimpleCategories( aProvider );
}