summaryrefslogtreecommitdiff
path: root/chart2/source/controller/main
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/controller/main')
-rw-r--r--chart2/source/controller/main/ChartController_Insert.cxx12
-rw-r--r--chart2/source/controller/main/ChartModelClone.cxx8
-rw-r--r--chart2/source/controller/main/ObjectHierarchy.cxx11
3 files changed, 15 insertions, 16 deletions
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index 611cd3dbd613..85f7ea5c345e 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -836,9 +836,9 @@ void ChartController::executeDispatch_InsertMinorGrid()
Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getModel() );
if( xAxis.is() )
{
- Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
- for( sal_Int32 nN=0; nN<aSubGrids.getLength(); nN++)
- AxisHelper::makeGridVisible( aSubGrids[nN] );
+ const Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
+ for( Reference< beans::XPropertySet > const & props : aSubGrids)
+ AxisHelper::makeGridVisible( props );
aUndoGuard.commit();
}
}
@@ -860,9 +860,9 @@ void ChartController::executeDispatch_DeleteMinorGrid()
Reference< XAxis > xAxis = ObjectIdentifier::getAxisForCID( m_aSelection.getSelectedCID(), getModel() );
if( xAxis.is() )
{
- Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
- for( sal_Int32 nN=0; nN<aSubGrids.getLength(); nN++)
- AxisHelper::makeGridInvisible( aSubGrids[nN] );
+ const Sequence< Reference< beans::XPropertySet > > aSubGrids( xAxis->getSubGridProperties() );
+ for( Reference< beans::XPropertySet > const & props : aSubGrids)
+ AxisHelper::makeGridInvisible( props );
aUndoGuard.commit();
}
}
diff --git a/chart2/source/controller/main/ChartModelClone.cxx b/chart2/source/controller/main/ChartModelClone.cxx
index 456bd178c81b..6348aee6e6f9 100644
--- a/chart2/source/controller/main/ChartModelClone.cxx
+++ b/chart2/source/controller/main/ChartModelClone.cxx
@@ -220,11 +220,11 @@ namespace chart
Reference< XDataSource > xUsedData( DataSourceHelper::getUsedData( i_model ) );
if ( xUsedData.is() && xNewDataProvider.is() )
{
- Sequence< Reference< XLabeledDataSequence > > aData( xUsedData->getDataSequences() );
- for( sal_Int32 i=0; i<aData.getLength(); ++i )
+ const Sequence< Reference< XLabeledDataSequence > > aData( xUsedData->getDataSequences() );
+ for( Reference< XLabeledDataSequence > const & labeledDataSeq : aData )
{
- xNewDataProvider->registerDataSequenceForChanges( aData[i]->getValues() );
- xNewDataProvider->registerDataSequenceForChanges( aData[i]->getLabel() );
+ xNewDataProvider->registerDataSequenceForChanges( labeledDataSeq->getValues() );
+ xNewDataProvider->registerDataSequenceForChanges( labeledDataSeq->getLabel() );
}
}
}
diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx
index 15b5392153b3..32762762e827 100644
--- a/chart2/source/controller/main/ObjectHierarchy.cxx
+++ b/chart2/source/controller/main/ObjectHierarchy.cxx
@@ -238,9 +238,9 @@ void ImplObjectHierarchy::createTree( const Reference< XChartDocument >& xChartD
if( !m_bOrderingForElementSelector )
{
// Axis Titles. Note: These are interpreted of being top level
- Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
- for( sal_Int32 i=0; i<aAxes.getLength(); ++i )
- lcl_addAxisTitle( aAxes[i], aTopLevelContainer, xModel );
+ const Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
+ for( Reference< XAxis > const & axis : aAxes )
+ lcl_addAxisTitle( axis, aTopLevelContainer, xModel );
// Diagram
aTopLevelContainer.push_back( aDiaOID );
@@ -319,9 +319,8 @@ void ImplObjectHierarchy::createAxesTree(
aAxes = AxisHelper::getAllAxesOfDiagram( xDiagram );
// Grids
Reference< frame::XModel > xChartModel = xChartDoc;
- for( sal_Int32 nA=0; nA<aAxes.getLength(); ++nA )
+ for( Reference< XAxis > const & xAxis : std::as_const(aAxes) )
{
- Reference< XAxis > xAxis( aAxes[nA] );
if(!xAxis.is())
continue;
@@ -339,7 +338,7 @@ void ImplObjectHierarchy::createAxesTree(
rContainer.emplace_back( ObjectIdentifier::createClassifiedIdentifierForObject( xAxis, xChartModel ) );
// axis title
- lcl_addAxisTitle( aAxes[nA], rContainer, xChartModel );
+ lcl_addAxisTitle( xAxis, rContainer, xChartModel );
}
Reference< beans::XPropertySet > xGridProperties( xAxis->getGridProperties() );