summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-08-26 20:57:37 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-08-30 12:37:37 +0200
commitfb1d5274bf4669692a500005416e300d10d77270 (patch)
tree34484eeea474edc223614d89f058643b0c9121e3
parent4570a7cebdebf9ac89c0c23971f68bde2f2de608 (diff)
cid#1606821 silence Overflowed constant
Change-Id: I7766f17113f83f849289e50524aeb63503bc4c93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172639 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r--sw/source/core/docnode/ndsect.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx
index 6a1f091b7c22..177dcfd9d37d 100644
--- a/sw/source/core/docnode/ndsect.cxx
+++ b/sw/source/core/docnode/ndsect.cxx
@@ -1416,8 +1416,14 @@ OUString SwDoc::GetUniqueSectionName( const OUString* pChkStr ) const
{
// Calculate the Number and reset the Flag
nNum = o3tl::toInt32(rNm.subView( aName.getLength() ));
- if( nNum-- && nNum < mpSectionFormatTable->size() )
- pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
+ if (nNum)
+ {
+ --nNum;
+ if (nNum < mpSectionFormatTable->size())
+ {
+ pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
+ }
+ }
}
if( pChkStr && *pChkStr==rNm )
pChkStr = nullptr;