sw/source/core/doc/DocumentRedlineManager.cxx |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit bf340cc7d08545dd2fd9c1c53a9f2907df3ad533
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun Sep 29 13:28:26 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Sep 30 08:07:33 2024 +0200

    cid#1606686 Overflowed constant
    
    Change-Id: Ib2e96b80ee91d5617ae643202187460df0eb05a7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174203
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx 
b/sw/source/core/doc/DocumentRedlineManager.cxx
index 411727e1880f..d510491fb8f4 100644
--- a/sw/source/core/doc/DocumentRedlineManager.cxx
+++ b/sw/source/core/doc/DocumentRedlineManager.cxx
@@ -1204,15 +1204,13 @@ void DocumentRedlineManager::SetRedlineFlags( 
RedlineFlags eMode )
         }
 
         for (sal_uInt16 nLoop = 1; nLoop <= 2; ++nLoop)
-            for (size_t i = 0; i < maRedlineTable.size(); ++i)
+            for (size_t i = 0; i < maRedlineTable.size(); )
             {
                 SwRangeRedline *const pRedline = maRedlineTable[i];
                 (pRedline->*pFnc)(nLoop, i, false);
-                while (maRedlineTable.size() <= i
-                    || maRedlineTable[i] != pRedline)
-                {        // ensure current position
-                    --i; // a previous redline may have been deleted
-                }
+                // a previous redline may have been deleted
+                if (i < maRedlineTable.size() && maRedlineTable[i] == pRedline)
+                    ++i;
             }
 
         //SwRangeRedline::MoveFromSection routinely changes

Reply via email to