From c30fa95c5d0e03c523d22d01be3ae4ce3b79c723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 24 Sep 2024 19:45:58 +0100 Subject: [PATCH] cid#1607313 silence Overflowed return value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and cid#1608099 Overflowed constant Change-Id: I10e08c1184bb6630b849c3e24a0c9b26302fd18a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173896 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- hwpfilter/source/hcode.cxx | 11 ++++------- sd/source/core/stlpool.cxx | 8 +++----- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/hwpfilter/source/hcode.cxx b/hwpfilter/source/hcode.cxx index 8bb22e06c956..9616529bbb33 100644 --- a/hwpfilter/source/hcode.cxx +++ b/hwpfilter/source/hcode.cxx @@ -522,19 +522,16 @@ static int KsSearch(hchar c) static hchar cdkssm2ks_han(hchar kssm) { - unsigned int index; - unsigned char lo, hi; - /* "One" */ if (kssm == 0xd3c5) return 0xc7d1; - index = KsSearch(kssm); + unsigned int index = KsSearch(kssm); if (kssm != ksTbl[index]) return jaso2ks(kssm); - hi = sal::static_int_cast(index / (0xFE - 0xA1 + 1) + 0xB0); - lo = sal::static_int_cast(index % (0xFE - 0xA1 + 1) + 0xA1); - return lo | (hi << 8); + unsigned char hi(index / (0xFE - 0xA1 + 1) + 0xB0); + unsigned char lo(index % (0xFE - 0xA1 + 1) + 0xA1); + return hchar(lo | (hi << 8)); } diff --git a/sd/source/core/stlpool.cxx b/sd/source/core/stlpool.cxx index 8ab0716d533f..2cfd2544fe00 100644 --- a/sd/source/core/stlpool.cxx +++ b/sd/source/core/stlpool.cxx @@ -978,12 +978,10 @@ void SdStyleSheetPool::UpdateStdNames() if( bHelpKnown ) { OUString aNewName; - if (pNameId) + if (pNameId && pNameId == STR_PSEUDOSHEET_OUTLINE) { - if (pNameId == STR_PSEUDOSHEET_OUTLINE) - { - aNewName += " " + OUString::number( sal_Int32( nHelpId - HID_PSEUDOSHEET_OUTLINE ) ); - } + assert(nHelpId >= HID_PSEUDOSHEET_OUTLINE1 && nHelpId <= HID_PSEUDOSHEET_OUTLINE9); + aNewName += " " + OUString::number( sal_Int32( nHelpId - HID_PSEUDOSHEET_OUTLINE ) ); } if( !aNewName.isEmpty() && aNewName != aOldName )