sw/source/uibase/uiview/view2.cxx |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 0bbbbeab38ab8924dce02bfbab6064eaf6f99470
Author:     mkt1 <[email protected]>
AuthorDate: Mon Oct 13 00:47:16 2025 -0700
Commit:     David Gilbert <[email protected]>
CommitDate: Thu Oct 16 16:55:31 2025 +0200

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

diff --git a/sw/source/uibase/uiview/view2.cxx 
b/sw/source/uibase/uiview/view2.cxx
index de0ab1d26b69..a115460dd1c2 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -421,10 +421,9 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
         }
 
         std::vector<OUString> aFormats;
-        const size_t nArrLen = pDoc->GetFrameFormats()->size();
-        for( size_t i = 0; i < nArrLen; ++i )
+        for( const auto& pSwFrameFormat : (*pDoc->GetFrameFormats()) )
         {
-            const SwFrameFormat* pFormat = (*pDoc->GetFrameFormats())[ i ];
+            const SwFrameFormat* pFormat = pSwFrameFormat;
             if(pFormat->IsDefault() || pFormat->IsAuto())
                 continue;
             aFormats.push_back(pFormat->GetName().toString());
@@ -445,11 +444,13 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq )
         Sequence<OUString> aListBoxEntries(aFormats.size());
         OUString* pEntries = aListBoxEntries.getArray();
         sal_Int16 nSelect = 0;
-        for( size_t i = 0; i < aFormats.size(); ++i )
+        sal_Int16 i = 0;
+        for( const auto& a : aFormats )
         {
-            pEntries[i] = aFormats[i];
+            pEntries[i] = a;
             if(pEntries[i] == sGraphicFormat)
                 nSelect = i;
+            ++i;
         }
         try
         {

Reply via email to