oox/source/export/DMLPresetShapeExport.cxx               |   36 +++++++--------
 stoc/test/registry_tdprovider/testregistrytdprovider.cxx |    4 -
 2 files changed, 19 insertions(+), 21 deletions(-)

New commits:
commit 87f52dbf4faf8dcd6fcc1b070e070b9ca8584ac4
Author:     ektagoel12 <[email protected]>
AuthorDate: Wed Jan 25 22:43:15 2023 +0000
Commit:     Hossein <[email protected]>
CommitDate: Thu Apr 6 12:09:49 2023 +0200

    tdf#145538 Use range based for loops
    
    Change-Id: Ib74318a36898270c7b6e45e5e064ddd696a91be8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145905
    Tested-by: Jenkins
    Reviewed-by: Hossein <[email protected]>

diff --git a/oox/source/export/DMLPresetShapeExport.cxx 
b/oox/source/export/DMLPresetShapeExport.cxx
index a2d08ec3e2e2..1eaef29927fa 100644
--- a/oox/source/export/DMLPresetShapeExport.cxx
+++ b/oox/source/export/DMLPresetShapeExport.cxx
@@ -43,47 +43,45 @@ DMLPresetShapeExporter::DMLPresetShapeExporter(DrawingML* 
pDMLExporter,
         = xShapeProps->getPropertyValue("CustomShapeGeometry")
               .get<uno::Sequence<beans::PropertyValue>>();
 
-    for (sal_uInt32 i = 0; i < aCustomShapeGeometry.size(); i++)
+    for (auto const& rCustomShapeGeometryItem : aCustomShapeGeometry)
     {
-        if (aCustomShapeGeometry[i].Name == "Type")
+        if (rCustomShapeGeometryItem.Name == "Type")
         {
-            m_sPresetShapeType = aCustomShapeGeometry[i].Value.get<OUString>();
+            m_sPresetShapeType = 
rCustomShapeGeometryItem.Value.get<OUString>();
         }
-        if (aCustomShapeGeometry[i].Name == "Handles")
+        if (rCustomShapeGeometryItem.Name == "Handles")
         {
             m_bHasHandleValues = true;
             m_HandleValues
-                = aCustomShapeGeometry[i]
-                      .Value
+                = rCustomShapeGeometryItem.Value
                       
.get<css::uno::Sequence<css::uno::Sequence<css::beans::PropertyValue>>>();
         }
-        if (aCustomShapeGeometry[i].Name == "AdjustmentValues")
+        if (rCustomShapeGeometryItem.Name == "AdjustmentValues")
         {
             m_AdjustmentValues
-                = aCustomShapeGeometry[i]
-                      .Value
+                = rCustomShapeGeometryItem.Value
                       
.get<css::uno::Sequence<css::drawing::EnhancedCustomShapeAdjustmentValue>>();
         }
-        if (aCustomShapeGeometry[i].Name == "MirroredX")
+        if (rCustomShapeGeometryItem.Name == "MirroredX")
         {
-            m_bIsFlipped.first = aCustomShapeGeometry[i].Value.get<bool>();
+            m_bIsFlipped.first = rCustomShapeGeometryItem.Value.get<bool>();
         }
-        if (aCustomShapeGeometry[i].Name == "MirroredY")
+        if (rCustomShapeGeometryItem.Name == "MirroredY")
         {
-            m_bIsFlipped.second = aCustomShapeGeometry[i].Value.get<bool>();
+            m_bIsFlipped.second = rCustomShapeGeometryItem.Value.get<bool>();
         }
-        //if (aCustomShapeGeometry[i].Name == "Equations")
+        //if (rCustomShapeGeometryItem.Name == "Equations")
         //{
-        //    m_Equations = 
aCustomShapeGeometry[i].Value.get<css::uno::Sequence<OUString>>();
+        //    m_Equations = 
rCustomShapeGeometryItem.Value.get<css::uno::Sequence<OUString>>();
         //}
-        //if (aCustomShapeGeometry[i].Name == "Path")
+        //if (rCustomShapeGeometryItem.Name == "Path")
         //{
-        //    m_Path = aCustomShapeGeometry[i]
+        //    m_Path = rCustomShapeGeometryItem
         //                 
.Value.get<css::uno::Sequence<css::beans::PropertyValue>>();
         //}
-        //if (aCustomShapeGeometry[i].Name == "ViewBox")
+        //if (rCustomShapeGeometryItem.Name == "ViewBox")
         //{
-        //    m_ViewBox = 
aCustomShapeGeometry[i].Value.get<css::awt::Rectangle>();
+        //    m_ViewBox = 
rCustomShapeGeometryItem.Value.get<css::awt::Rectangle>();
         //}
     }
 };
diff --git a/stoc/test/registry_tdprovider/testregistrytdprovider.cxx 
b/stoc/test/registry_tdprovider/testregistrytdprovider.cxx
index 359c4b789f3b..879859b92e27 100644
--- a/stoc/test/registry_tdprovider/testregistrytdprovider.cxx
+++ b/stoc/test/registry_tdprovider/testregistrytdprovider.cxx
@@ -776,9 +776,9 @@ bool writeInfo(void * registryKey, OUString const & 
implementationName,
         return false;
     }
     bool success = true;
-    for (sal_Int32 i = 0; i < serviceNames.getLength(); ++i) {
+    for (auto const& rServiceName : serviceNames) {
         try {
-            key->createKey(serviceNames[i]);
+            key->createKey(rServiceName);
         } catch (css::registry::InvalidRegistryException &) {
             success = false;
             break;

Reply via email to