sw/source/filter/ww8/ww8par.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit d2e937d93f0646480d92101115e5b4a4f41f2acc
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Aug 26 21:12:42 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Wed Aug 28 12:17:25 2024 +0200

    cid#1606927 silence Overflowed constant
    
    Change-Id: I4c111bbdbf9d600a1d75a071010164b56d0ed06b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172510
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index ab2dbdc242a6..c3abc3d1b0e3 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1197,14 +1197,17 @@ SwFltStackEntry* SwWW8FltControlStack::SetAttr(const 
SwPosition& rPos, sal_uInt1
     if (m_rReader.m_xPlcxMan && m_rReader.m_xPlcxMan->GetDoingDrawTextBox())
     {
         size_t nCnt = size();
-        for (size_t i=0; i < nCnt; ++i)
+        size_t i = 0;
+        while (i < nCnt)
         {
             SwFltStackEntry& rEntry = (*this)[i];
             if (nAttrId == rEntry.m_pAttr->Which())
             {
-                DeleteAndDestroy(i--);
+                DeleteAndDestroy(i);
                 --nCnt;
+                break;
             }
+            ++i;
         }
     }
     else // Normal case, set the attribute into the document

Reply via email to