summaryrefslogtreecommitdiff
path: root/chart2/source/tools/ReferenceSizeProvider.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-05-18 09:17:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-05-18 11:28:50 +0200
commit337a9a454c1bc95214111578d3f9c0622c55c509 (patch)
tree4eda99edf46e45ce804fcde98197cf0d96b7ac3d /chart2/source/tools/ReferenceSizeProvider.cxx
parent6089755d197528d071906846c58a397add0876a5 (diff)
use for-range on Sequence in chart2
Change-Id: Ief02e5d5284b0cbad26b04c0a282dccfee577b90 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94398 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'chart2/source/tools/ReferenceSizeProvider.cxx')
-rw-r--r--chart2/source/tools/ReferenceSizeProvider.cxx30
1 files changed, 15 insertions, 15 deletions
diff --git a/chart2/source/tools/ReferenceSizeProvider.cxx b/chart2/source/tools/ReferenceSizeProvider.cxx
index 865acc660c08..44109500552a 100644
--- a/chart2/source/tools/ReferenceSizeProvider.cxx
+++ b/chart2/source/tools/ReferenceSizeProvider.cxx
@@ -71,12 +71,12 @@ void ReferenceSizeProvider::setValuesAtTitle(
// set from auto-resize on to off -> adapt font sizes at XFormattedStrings
if( bHasOldRefSize && ! useAutoScale())
{
- uno::Sequence< uno::Reference< XFormattedString > > aStrSeq(
+ const uno::Sequence< uno::Reference< XFormattedString > > aStrSeq(
xTitle->getText());
- for( sal_Int32 i=0; i<aStrSeq.getLength(); ++i )
+ for( uno::Reference< XFormattedString > const & formattedStr : aStrSeq )
{
RelativeSizeHelper::adaptFontSizes(
- Reference< beans::XPropertySet >( aStrSeq[i], uno::UNO_QUERY ),
+ Reference< beans::XPropertySet >( formattedStr, uno::UNO_QUERY ),
aOldRefSize, getPageSize());
}
}
@@ -108,9 +108,9 @@ void ReferenceSizeProvider::setValuesAtAllDataSeries()
{
if( xSeriesProp->getPropertyValue( "AttributedDataPoints") >>= aPointIndexes )
{
- for( sal_Int32 i=0; i< aPointIndexes.getLength(); ++i )
+ for( sal_Int32 idx : aPointIndexes )
setValuesAtPropertySet(
- elem->getDataPointByIndex( aPointIndexes[i] ) );
+ elem->getDataPointByIndex( idx ) );
}
}
catch (const uno::Exception&)
@@ -248,13 +248,13 @@ ReferenceSizeProvider::AutoResizeState ReferenceSizeProvider::getAutoResizeState
return eResult;
// Axes (incl. Axis Titles)
- Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
- for( sal_Int32 i=0; i<aAxes.getLength(); ++i )
+ const Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
+ for( Reference< XAxis > const & axis : aAxes )
{
- Reference< beans::XPropertySet > xProp( aAxes[i], uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xProp( axis, uno::UNO_QUERY );
if( xProp.is())
getAutoResizeFromPropSet( xProp, eResult );
- Reference< XTitled > xTitled( aAxes[i], uno::UNO_QUERY );
+ Reference< XTitled > xTitled( axis, uno::UNO_QUERY );
if( xTitled.is())
{
impl_getAutoResizeFromTitled( xTitled, eResult );
@@ -282,10 +282,10 @@ ReferenceSizeProvider::AutoResizeState ReferenceSizeProvider::getAutoResizeState
{
if( xSeriesProp->getPropertyValue( "AttributedDataPoints") >>= aPointIndexes )
{
- for( sal_Int32 i=0; i< aPointIndexes.getLength(); ++i )
+ for( sal_Int32 idx : aPointIndexes )
{
getAutoResizeFromPropSet(
- elem->getDataPointByIndex( aPointIndexes[i] ), eResult );
+ elem->getDataPointByIndex( idx ), eResult );
if( eResult == AUTO_RESIZE_AMBIGUOUS )
return eResult;
}
@@ -330,13 +330,13 @@ void ReferenceSizeProvider::setAutoResizeState( ReferenceSizeProvider::AutoResiz
setValuesAtPropertySet( xLegendProp );
// Axes (incl. Axis Titles)
- Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
- for( sal_Int32 i=0; i<aAxes.getLength(); ++i )
+ const Sequence< Reference< XAxis > > aAxes( AxisHelper::getAllAxesOfDiagram( xDiagram ) );
+ for( Reference< XAxis > const & axis : aAxes )
{
- Reference< beans::XPropertySet > xProp( aAxes[i], uno::UNO_QUERY );
+ Reference< beans::XPropertySet > xProp( axis, uno::UNO_QUERY );
if( xProp.is())
setValuesAtPropertySet( xProp );
- impl_setValuesAtTitled( Reference< XTitled >( aAxes[i], uno::UNO_QUERY ));
+ impl_setValuesAtTitled( Reference< XTitled >( axis, uno::UNO_QUERY ));
}
// DataSeries/Points