sw/source/core/table/swtable.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 8f55160f25600039cb584975b8ff893f0453e485
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Oct 15 13:05:28 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Oct 17 13:19:02 2024 +0200

    cid#1606687 silence Overflowed integer argument
    
    Change-Id: I692ac9745c0f2811e7e8d155d0aeeee578d358fc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175068
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index fbda582fb3f9..8fb34eb88f6b 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -1221,14 +1221,13 @@ void SwTable::NewSetTabCols( Parm &rParm, const 
SwTabCols &rNew,
             }
             lcl_CalcNewWidths( aRowSpanPos, aCopy, rLines[nCurr],
                 rParm.nOldWish, nOldWidth, true );
-            bool bGoOn = !aRowSpanPos.empty();
             sal_uInt16 j = nCurr;
-            while( bGoOn )
+            while (!aRowSpanPos.empty() && j > 0)
             {
-                lcl_CalcNewWidths( aRowSpanPos, aCopy, rLines[--j],
+                j = o3tl::sanitizing_dec(j);
+                lcl_CalcNewWidths( aRowSpanPos, aCopy, rLines[j],
                     rParm.nOldWish, nOldWidth, true );
                 lcl_AdjustWidthsInLine( rLines[j], aCopy, rParm, 0 );
-                bGoOn = !aRowSpanPos.empty() && j > 0;
             }
             aRowSpanPos.clear();
         }

Reply via email to