chart2/source/controller/main/ToolbarController.cxx |    5 ++---
 drawinglayer/source/dumper/XShapeDumper.cxx         |    5 ++---
 filter/source/xsltfilter/XSLTFilter.cxx             |    7 +++----
 3 files changed, 7 insertions(+), 10 deletions(-)

New commits:
commit 582bf1a27c5adc6684e8d9af3805cfe40fa051d5
Author:     dtm <dan...@fearnley.net>
AuthorDate: Mon Dec 20 22:32:12 2021 +0000
Commit:     Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
CommitDate: Wed Jan 12 20:13:28 2022 +0100

    tdf#145538 - Use range based for loops
    
    Change-Id: Ib16c742b39af62694ef591dcdaa975b9a720b4a0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127203
    Tested-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>
    Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org>

diff --git a/chart2/source/controller/main/ToolbarController.cxx 
b/chart2/source/controller/main/ToolbarController.cxx
index 495afe526ded..4fd0990bfbf4 100644
--- a/chart2/source/controller/main/ToolbarController.cxx
+++ b/chart2/source/controller/main/ToolbarController.cxx
@@ -22,11 +22,10 @@ namespace chart {
 ChartToolbarController::ChartToolbarController(const 
css::uno::Sequence<css::uno::Any>& rProperties)
 {
     css::uno::Reference<css::frame::XFrame> xFrame;
-    sal_Int32 nLength = rProperties.getLength();
-    for (sal_Int32 i = 0; i < nLength; ++i)
+    for (const auto& rProperty : rProperties)
     {
         css::beans::PropertyValue aPropValue;
-        rProperties[i] >>= aPropValue;
+        rProperty >>= aPropValue;
         if (aPropValue.Name == "Frame")
             aPropValue.Value >>= xFrame;
     }
diff --git a/drawinglayer/source/dumper/XShapeDumper.cxx 
b/drawinglayer/source/dumper/XShapeDumper.cxx
index 1434de2ba219..d0e2cf97a1f5 100644
--- a/drawinglayer/source/dumper/XShapeDumper.cxx
+++ b/drawinglayer/source/dumper/XShapeDumper.cxx
@@ -1077,9 +1077,8 @@ void dumpInteropGrabBagAsElement(const uno::Sequence< 
beans::PropertyValue>& aIn
 {
     (void)xmlTextWriterStartElement(xmlWriter, BAD_CAST( "InteropGrabBag" ));
 
-    sal_Int32 nLength = aInteropGrabBag.getLength();
-    for (sal_Int32 i = 0; i < nLength; ++i)
-        dumpPropertyValueAsElement(aInteropGrabBag[i], xmlWriter);
+    for (const auto& item: aInteropGrabBag)
+        dumpPropertyValueAsElement(item, xmlWriter);
 
     (void)xmlTextWriterEndElement( xmlWriter );
 }
diff --git a/filter/source/xsltfilter/XSLTFilter.cxx 
b/filter/source/xsltfilter/XSLTFilter.cxx
index 4a8cd64b4fe6..d449cee7ffd9 100644
--- a/filter/source/xsltfilter/XSLTFilter.cxx
+++ b/filter/source/xsltfilter/XSLTFilter.cxx
@@ -311,14 +311,13 @@ namespace XSLT
         // the input stream that represents the imported file
         // is most important here since we need to supply it to
         // the sax parser that drives the supplied document handler
-        sal_Int32 nLength = aSourceData.getLength();
         OUString aName, aURL;
         css::uno::Reference<XInputStream> xInputStream;
         css::uno::Reference<XInteractionHandler> xInterActionHandler;
-        for (sal_Int32 i = 0; i < nLength; i++)
+        for (const auto& sourceDataItem : aSourceData)
         {
-            aName = aSourceData[i].Name;
-            Any value = aSourceData[i].Value;
+            aName = sourceDataItem.Name;
+            Any value = sourceDataItem.Value;
             if ( aName == "InputStream" )
                 value >>= xInputStream;
             else if ( aName == "URL" )

Reply via email to