summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-10-19 12:30:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-10-19 22:24:44 +0200
commit2bb1a0bf95570b205e181235bb906eaadc949318 (patch)
tree2d771375beabc461cdb43694c04d9930c082f03a /chart2
parent8d645c36b8cee4850884390fac4d858ceeff1108 (diff)
loop run a maximum of once
revealed since... commit f69585c35411ca74e17bb6cd1cf535489472a4c2 Date: Tue Mar 1 20:38:22 2016 +0200 loplugin:unuseddefaultparams in chart2 Change-Id: I805680f7087313b1bb678ab6f6756d7a2ccc3720 Reviewed-on: https://gerrit.libreoffice.org/61991 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/tools/DiagramHelper.cxx33
1 files changed, 15 insertions, 18 deletions
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index c3d9104e8e98..f7be64b86c3b 100644
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -280,26 +280,23 @@ void DiagramHelper::setStackMode(
if( !xChartTypeContainer.is() )
continue;
uno::Sequence< uno::Reference< XChartType > > aChartTypeList( xChartTypeContainer->getChartTypes() );
- sal_Int32 nMax = aChartTypeList.getLength();
- if( nMax >= 1 )
- nMax = 1;
- for( sal_Int32 nT = 0; nT < nMax; ++nT )
- {
- uno::Reference< XChartType > xChartType( aChartTypeList[nT] );
+ if (!aChartTypeList.getLength())
+ continue;
- //iterate through all series in this chart type
- uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY );
- OSL_ASSERT( xDataSeriesContainer.is());
- if( !xDataSeriesContainer.is() )
- continue;
+ uno::Reference< XChartType > xChartType( aChartTypeList[0] );
- uno::Sequence< uno::Reference< XDataSeries > > aSeriesList( xDataSeriesContainer->getDataSeries() );
- for( sal_Int32 nS = 0; nS < aSeriesList.getLength(); ++nS )
- {
- Reference< beans::XPropertySet > xProp( aSeriesList[nS], uno::UNO_QUERY );
- if(xProp.is())
- xProp->setPropertyValue( "StackingDirection", aNewDirection );
- }
+ //iterate through all series in this chart type
+ uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY );
+ OSL_ASSERT( xDataSeriesContainer.is());
+ if( !xDataSeriesContainer.is() )
+ continue;
+
+ uno::Sequence< uno::Reference< XDataSeries > > aSeriesList( xDataSeriesContainer->getDataSeries() );
+ for( sal_Int32 nS = 0; nS < aSeriesList.getLength(); ++nS )
+ {
+ Reference< beans::XPropertySet > xProp( aSeriesList[nS], uno::UNO_QUERY );
+ if(xProp.is())
+ xProp->setPropertyValue( "StackingDirection", aNewDirection );
}
}
}