chart2/source/controller/main/ChartController.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
New commits: commit 7cc55dd0c4c3bdc1761c1f5112d2d1b858953067 Author: Jussi Suominen <[email protected]> AuthorDate: Sat Oct 18 15:59:59 2025 +0300 Commit: Ilmari Lauhakangas <[email protected]> CommitDate: Tue Oct 21 17:01:59 2025 +0200 tdf#145538 Use range based for loops in ChartController.cxx Change-Id: If575d44f0c855e9211199e9f5461720e12934ccf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192644 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <[email protected]> diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx index 99bc0c55b94b..7d6f0edcd529 100644 --- a/chart2/source/controller/main/ChartController.cxx +++ b/chart2/source/controller/main/ChartController.cxx @@ -1297,10 +1297,9 @@ void SAL_CALL ChartController::dispatch( const Sequence<Reference<chart2::XFormattedString>> aStrings( xTitle->getText()); xProperties.pop_back(); - for (int i = 0; i < aStrings.getLength(); i++) + for (const auto& aString : aStrings) { - Reference<beans::XPropertySet> xTitlePropSet(aStrings[i], - uno::UNO_QUERY); + Reference<beans::XPropertySet> xTitlePropSet(aString, uno::UNO_QUERY); xProperties.push_back(xTitlePropSet); } } @@ -1310,9 +1309,9 @@ void SAL_CALL ChartController::dispatch( } } bool bAllPropertiesExist = (xProperties.size() > 0); - for (std::size_t i = 0; i < xProperties.size(); i++) + for (const auto& xProperty : xProperties) { - if (!xProperties[i].is()) + if (!xProperty.is()) bAllPropertiesExist = false; } if (bAllPropertiesExist)
