Kaydet (Commit) 2bb1a0bf authored tarafından Caolán McNamara's avatar Caolán McNamara

loop run a maximum of once

revealed since...

commit f69585c3
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: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 8d645c36
......@@ -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 );
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment