sw/source/uibase/docvw/PostItMgr.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit c0dea8a724cecb1ab01be0d9e73d0aeafc59e755
Author:     AnamayNarkar <[email protected]>
AuthorDate: Tue Jan 13 01:42:44 2026 +0530
Commit:     Hossein <[email protected]>
CommitDate: Wed Jan 14 11:45:13 2026 +0100

    tdf#145538 Use range-based for loops in SwPostItMgr
    
    Replaced iterators with range-based loops in UpdatePostItsParentInfo.
    
    Change-Id: Ib2e79268857619bf02a67f7f41714c3ab8483575
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197147
    Reviewed-by: Hossein <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/source/uibase/docvw/PostItMgr.cxx 
b/sw/source/uibase/docvw/PostItMgr.cxx
index f5edf6fb607e..fc93c7ddc80c 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -1614,15 +1614,15 @@ std::vector<SwFormatField*> 
SwPostItMgr::UpdatePostItsParentInfo()
     std::vector<SwFormatField*> vFormatFields;
     pType->CollectPostIts(vFormatFields, rIDRA, 
mpWrtShell->GetLayout()->IsHideRedlines());
 
-    for (std::vector<SwFormatField*>::iterator i = vFormatFields.begin(); i != 
vFormatFields.end(); i++)
+    for (SwFormatField* pChildFormatField : vFormatFields)
     {
-        SwPostItField *pChildPostIt = 
static_cast<SwPostItField*>((*i)->GetField());
+        SwPostItField *pChildPostIt = 
static_cast<SwPostItField*>(pChildFormatField->GetField());
 
         if (pChildPostIt->GetParentId() != 0 || 
!pChildPostIt->GetParentName().isEmpty())
         {
-            for (std::vector<SwFormatField*>::iterator j = 
vFormatFields.begin(); j != vFormatFields.end(); j++)
+            for (SwFormatField* pParentFormatField : vFormatFields)
             {
-                SwPostItField *pParentPostIt = 
static_cast<SwPostItField*>((*j)->GetField());
+                SwPostItField *pParentPostIt = 
static_cast<SwPostItField*>(pParentFormatField->GetField());
                 if (pChildPostIt->GetParentId() != 0 && 
pParentPostIt->GetParaId() == pChildPostIt->GetParentId())
                 {
                     
pChildPostIt->SetParentPostItId(pParentPostIt->GetPostItId());

Reply via email to