dbaccess/source/ui/browser/sbagrid.cxx | 2 +- sal/osl/unx/file_url.cxx | 2 +- sc/source/filter/excel/xipage.cxx | 3 ++- sd/source/ui/annotations/annotationmanager.cxx | 2 +- sd/source/ui/view/ViewShellManager.cxx | 5 ++++- sd/source/ui/view/viewshel.cxx | 5 ++++- sw/source/core/doc/DocumentStylePoolManager.cxx | 5 ++++- 7 files changed, 17 insertions(+), 7 deletions(-)
New commits: commit 228946f64c2725e9662d3aa2983b8835d34d99fe Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Sep 1 14:46:56 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Sep 2 21:14:19 2024 +0200 cid#1607774 silence Overflowed integer argument Change-Id: Iebe15d0323253ebb06b26fc42e78993be5fa92d1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172771 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sal/osl/unx/file_url.cxx b/sal/osl/unx/file_url.cxx index ffb1559356a8..ed61289d339d 100644 --- a/sal/osl/unx/file_url.cxx +++ b/sal/osl/unx/file_url.cxx @@ -389,7 +389,7 @@ oslFileError SAL_CALL osl_getFileURLFromSystemPath( rtl_uString *ustrSystemPath, /* check if initial string contains repeated '/' characters */ nIndex = systemPath.indexOf( "//" ); - if( nIndex != -1 ) + if (nIndex >= 0) { sal_Int32 nSrcIndex; sal_Int32 nDeleted = 0; commit 3b4a5e047283a23be2a7b4b2b057ee97c7c99113 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Sep 1 15:28:31 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Sep 2 21:14:06 2024 +0200 cid#1608421 silence Overflowed constant and cid#1608468 silence Overflowed constant cid#1608519 silence Overflowed constant cid#1608531 silence Overflowed constant cid#1607216 silence Overflowed constant cid#1606854 silence Overflowed constant Change-Id: I805be34fe58895af3898ff9729aa3b3d3964221e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172770 Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 2657c9e741ff..58017ff4c24c 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -898,7 +898,7 @@ void SbaGridControl::MouseButtonDown( const BrowserMouseEvent& rMEvt) { sal_Int32 nRow = GetRowAtYPosPixel(rMEvt.GetPosPixel().Y()); sal_uInt16 nColPos = GetColumnAtXPosPixel(rMEvt.GetPosPixel().X()); - sal_uInt16 nViewPos = (nColPos == BROWSER_INVALIDID) ? sal_uInt16(-1) : nColPos-1; + sal_uInt16 nViewPos = (nColPos == BROWSER_INVALIDID) ? sal_uInt16(-1) : sal_uInt16(nColPos - 1); // 'the handle column' and 'no valid column' will both result in a view position of -1 ! bool bHitEmptySpace = (nRow > GetRowCount()) || (nViewPos == sal_uInt16(-1)); diff --git a/sc/source/filter/excel/xipage.cxx b/sc/source/filter/excel/xipage.cxx index 6f7cd659567c..bfb775fe321e 100644 --- a/sc/source/filter/excel/xipage.cxx +++ b/sc/source/filter/excel/xipage.cxx @@ -157,13 +157,14 @@ void XclImpPageSettings::ReadPageBreaks( XclImpStream& rStrm ) pVec->clear(); pVec->reserve( nCount ); - while( nCount-- ) + while (nCount) { sal_uInt16 nBreak = rStrm.ReaduInt16(); if( nBreak ) pVec->push_back( nBreak ); if( bIgnore ) rStrm.Ignore( 4 ); + --nCount; } } diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index d3d70d45badb..570ce48f07f1 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -1213,7 +1213,7 @@ SdPage* AnnotationManagerImpl::GetNextPage( SdPage const * pPage, bool bForward return mpDoc->GetMasterSdPage( mpDoc->GetMasterSdPageCount(PageKind::Standard) - 1, PageKind::Standard ); // last page } - sal_uInt16 nPageNum = (pPage->GetPageNum() - 1) >> 1; + sal_uInt16 nPageNum = static_cast<sal_uInt16>((pPage->GetPageNum() - 1) >> 1); // first all non master pages if( !pPage->IsMasterPage() ) diff --git a/sd/source/ui/view/ViewShellManager.cxx b/sd/source/ui/view/ViewShellManager.cxx index c6fd5fa843ae..e5cbd13770af 100644 --- a/sd/source/ui/view/ViewShellManager.cxx +++ b/sd/source/ui/view/ViewShellManager.cxx @@ -767,8 +767,11 @@ void ViewShellManager::Implementation::UpdateShellStack() while (mrBase.GetSubShell(nIndex)!=nullptr) ++nIndex; aSfxShellStack.reserve(nIndex); - while (nIndex-- > 0) + while (nIndex > 0) + { + --nIndex; aSfxShellStack.push_back(mrBase.GetSubShell(nIndex)); + } #if OSL_DEBUG_LEVEL >= 2 SAL_INFO("sd.view", __func__ << ": Current SFX Stack"); diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index c90788a284ec..23f6d811c0cd 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -1444,8 +1444,11 @@ void ViewShell::ImpSidRedo(SfxRequest& rReq) { // when UndoStack is cleared by ModifyPageRedoAction // the nCount may have changed, so test GetRedoActionCount() - while(nNumber-- && pUndoManager->GetRedoActionCount()) + while (nNumber && pUndoManager->GetRedoActionCount()) + { pUndoManager->Redo(); + --nNumber; + } } catch( const Exception& ) { diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index 06909c556ab3..a92a19cd5dd4 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -1514,7 +1514,9 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId ) } OSL_ENSURE(pRCId, "invalid Id"); - while( nArrCnt-- ) + while (nArrCnt) + { + --nArrCnt; for( size_t n = 0; n < (*pArray[nArrCnt]).GetFormatCount(); ++n ) { pNewFormat = (*pArray[ nArrCnt ] ).GetFormat( n ); @@ -1523,6 +1525,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId ) return pNewFormat; } } + } OUString aNm(SwResId(pRCId)); SwAttrSet aSet(m_rDoc.GetAttrPool(), *pWhichRange);