sw/source/ui/dbui/dbinsdlg.cxx |    4 ++--
 sw/source/ui/misc/glosbib.cxx  |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 2c062231bc14d8bca25600f021a31209eb19df29
Author:     Triyambak <[email protected]>
AuthorDate: Wed Jan 21 03:16:08 2026 +0530
Commit:     Ilmari Lauhakangas <[email protected]>
CommitDate: Fri Jan 23 13:33:42 2026 +0100

    tdf#145538 Use range-based for loops in sw UI code
    
    Replace index-based loops with C++ range-based for loops
    to improve readability and reduce indexing errors.
    
    Change-Id: I844aea0fb927ceff2ae6324b868dca7a7094aefd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197704
    Reviewed-by: Ilmari Lauhakangas <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 4eca817a0c9b..5d93b7377bbc 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -533,8 +533,8 @@ IMPL_LINK( SwInsertDBColAutoPilot, TableToFromHdl, 
weld::Button&, rButton, void
 
         m_xLbTableDbColumn->clear();
         m_xLbTableCol->clear();
-        for (size_t n = 0; n < m_aDBColumns.size(); ++n)
-            m_xLbTableDbColumn->append_text(m_aDBColumns[n]->sColumn);
+        for (const auto& pColumn : m_aDBColumns)
+            m_xLbTableDbColumn->append_text(pColumn->sColumn);
 
         m_xLbTableDbColumn->thaw();
         m_xLbTableCol->thaw();
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index 59121058b5dc..fa7d39863a0f 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -71,9 +71,9 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(weld::Window * pParent,
     m_xNameED->connect_size_allocate(LINK(this, SwGlossaryGroupDlg, 
EntrySizeAllocHdl));
     m_xPathLB->connect_size_allocate(LINK(this, SwGlossaryGroupDlg, 
EntrySizeAllocHdl));
 
-    for (size_t i = 0; i < rPathArr.size(); ++i)
+    for (const auto& rPath : rPathArr)
     {
-        INetURLObject aTempURL(rPathArr[i]);
+        INetURLObject aTempURL(rPath);
         const OUString sPath = 
aTempURL.GetMainURL(INetURLObject::DecodeMechanism::WithCharset );
         sal_uInt32 nCaseReadonly = 0;
         utl::TempFileNamed aTempFile(&sPath);

Reply via email to