diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-18 09:17:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-05-18 11:28:50 +0200 |
commit | 337a9a454c1bc95214111578d3f9c0622c55c509 (patch) | |
tree | 4eda99edf46e45ce804fcde98197cf0d96b7ac3d /chart2/source/view/main/ShapeFactory.cxx | |
parent | 6089755d197528d071906846c58a397add0876a5 (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/view/main/ShapeFactory.cxx')
-rw-r--r-- | chart2/source/view/main/ShapeFactory.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/chart2/source/view/main/ShapeFactory.cxx b/chart2/source/view/main/ShapeFactory.cxx index 1ec43352b8b6..26a598931c29 100644 --- a/chart2/source/view/main/ShapeFactory.cxx +++ b/chart2/source/view/main/ShapeFactory.cxx @@ -2438,8 +2438,8 @@ uno::Reference< drawing::XShape > if( xFormattedString.hasElements() ) { OUString aLabel; - for( sal_Int32 nN=0; nN<xFormattedString.getLength();nN++ ) - aLabel += xFormattedString[nN]->getString(); + for( const auto & i : std::as_const(xFormattedString) ) + aLabel += i->getString(); aLabel = ShapeFactory::getStackedString( aLabel, bStackCharacters ); xTextCursor->gotoEnd(false); @@ -2461,11 +2461,10 @@ uno::Reference< drawing::XShape > } else { - sal_Int32 nN = 0; - for( nN=0; nN<xFormattedString.getLength();nN++ ) + for( const uno::Reference< chart2::XFormattedString >& rxFS : std::as_const(xFormattedString) ) { xTextCursor->gotoEnd(false); - xText->insertString( xTextCursor, xFormattedString[nN]->getString(), false ); + xText->insertString( xTextCursor, rxFS->getString(), false ); xTextCursor->gotoEnd(true); } awt::Size aOldRefSize; @@ -2641,8 +2640,8 @@ OUString ShapeFactory::getStackedString( const OUString& rString, bool bStacked bool ShapeFactory::hasPolygonAnyLines( drawing::PolyPolygonShape3D& rPoly) { // #i67757# check all contained polygons, if at least one polygon contains 2 or more points, return true - for( sal_Int32 nIdx = 0, nCount = rPoly.SequenceX.getLength(); nIdx < nCount; ++nIdx ) - if( rPoly.SequenceX[ nIdx ].getLength() > 1 ) + for( auto const & i : std::as_const(rPoly.SequenceX) ) + if( i.getLength() > 1 ) return true; return false; } |