sw/source/filter/ww8/wrtw8sty.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 8536bb07ac92ecf5a4046d5bacd968c4f8ed5763
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Sep 27 19:27:34 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sat Sep 28 20:22:07 2024 +0200

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

diff --git a/sw/source/filter/ww8/wrtw8sty.cxx 
b/sw/source/filter/ww8/wrtw8sty.cxx
index ff7d30bd84dc..c5868b517211 100644
--- a/sw/source/filter/ww8/wrtw8sty.cxx
+++ b/sw/source/filter/ww8/wrtw8sty.cxx
@@ -219,7 +219,7 @@ sal_uInt16 MSWordStyles::GetSlot( const SwFormat* pFormat ) 
const
 /// Get reserved slot number during building the style table.
 static sal_uInt16 BuildGetSlot(const SwFormat& rFormat)
 {
-    switch (sal_uInt16 nRet = rFormat.GetPoolFormatId())
+    switch (sal_uInt16 nId = rFormat.GetPoolFormatId())
     {
         case RES_POOLCOLL_STANDARD:
             return 0;
@@ -233,9 +233,11 @@ static sal_uInt16 BuildGetSlot(const SwFormat& rFormat)
         case RES_POOLCOLL_HEADLINE7:
         case RES_POOLCOLL_HEADLINE8:
         case RES_POOLCOLL_HEADLINE9:
-            nRet -= RES_POOLCOLL_HEADLINE1-1;
+        {
+            sal_uInt16 nRet = nId - (RES_POOLCOLL_HEADLINE1 - 1);
             assert(nRet < WW8_RESERVED_SLOTS);
             return nRet;
+        }
     }
     return 0xfff;
 }

Reply via email to