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.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
Caolán McNamara
2024-09-01 15:28:31 +01:00
parent 02f01fea46
commit 3b4a5e0472
6 changed files with 16 additions and 6 deletions

View File

@@ -898,7 +898,7 @@ void SbaGridControl::MouseButtonDown( const BrowserMouseEvent& rMEvt)
{ {
sal_Int32 nRow = GetRowAtYPosPixel(rMEvt.GetPosPixel().Y()); sal_Int32 nRow = GetRowAtYPosPixel(rMEvt.GetPosPixel().Y());
sal_uInt16 nColPos = GetColumnAtXPosPixel(rMEvt.GetPosPixel().X()); 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 ! // 'the handle column' and 'no valid column' will both result in a view position of -1 !
bool bHitEmptySpace = (nRow > GetRowCount()) || (nViewPos == sal_uInt16(-1)); bool bHitEmptySpace = (nRow > GetRowCount()) || (nViewPos == sal_uInt16(-1));

View File

@@ -157,13 +157,14 @@ void XclImpPageSettings::ReadPageBreaks( XclImpStream& rStrm )
pVec->clear(); pVec->clear();
pVec->reserve( nCount ); pVec->reserve( nCount );
while( nCount-- ) while (nCount)
{ {
sal_uInt16 nBreak = rStrm.ReaduInt16(); sal_uInt16 nBreak = rStrm.ReaduInt16();
if( nBreak ) if( nBreak )
pVec->push_back( nBreak ); pVec->push_back( nBreak );
if( bIgnore ) if( bIgnore )
rStrm.Ignore( 4 ); rStrm.Ignore( 4 );
--nCount;
} }
} }

View File

@@ -1213,7 +1213,7 @@ SdPage* AnnotationManagerImpl::GetNextPage( SdPage const * pPage, bool bForward
return mpDoc->GetMasterSdPage( mpDoc->GetMasterSdPageCount(PageKind::Standard) - 1, PageKind::Standard ); // last page 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 // first all non master pages
if( !pPage->IsMasterPage() ) if( !pPage->IsMasterPage() )

View File

@@ -767,8 +767,11 @@ void ViewShellManager::Implementation::UpdateShellStack()
while (mrBase.GetSubShell(nIndex)!=nullptr) while (mrBase.GetSubShell(nIndex)!=nullptr)
++nIndex; ++nIndex;
aSfxShellStack.reserve(nIndex); aSfxShellStack.reserve(nIndex);
while (nIndex-- > 0) while (nIndex > 0)
{
--nIndex;
aSfxShellStack.push_back(mrBase.GetSubShell(nIndex)); aSfxShellStack.push_back(mrBase.GetSubShell(nIndex));
}
#if OSL_DEBUG_LEVEL >= 2 #if OSL_DEBUG_LEVEL >= 2
SAL_INFO("sd.view", __func__ << ": Current SFX Stack"); SAL_INFO("sd.view", __func__ << ": Current SFX Stack");

View File

@@ -1444,8 +1444,11 @@ void ViewShell::ImpSidRedo(SfxRequest& rReq)
{ {
// when UndoStack is cleared by ModifyPageRedoAction // when UndoStack is cleared by ModifyPageRedoAction
// the nCount may have changed, so test GetRedoActionCount() // the nCount may have changed, so test GetRedoActionCount()
while(nNumber-- && pUndoManager->GetRedoActionCount()) while (nNumber && pUndoManager->GetRedoActionCount())
{
pUndoManager->Redo(); pUndoManager->Redo();
--nNumber;
}
} }
catch( const Exception& ) catch( const Exception& )
{ {

View File

@@ -1514,7 +1514,9 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId )
} }
OSL_ENSURE(pRCId, "invalid Id"); OSL_ENSURE(pRCId, "invalid Id");
while( nArrCnt-- ) while (nArrCnt)
{
--nArrCnt;
for( size_t n = 0; n < (*pArray[nArrCnt]).GetFormatCount(); ++n ) for( size_t n = 0; n < (*pArray[nArrCnt]).GetFormatCount(); ++n )
{ {
pNewFormat = (*pArray[ nArrCnt ] ).GetFormat( n ); pNewFormat = (*pArray[ nArrCnt ] ).GetFormat( n );
@@ -1523,6 +1525,7 @@ SwFormat* DocumentStylePoolManager::GetFormatFromPool( sal_uInt16 nId )
return pNewFormat; return pNewFormat;
} }
} }
}
OUString aNm(SwResId(pRCId)); OUString aNm(SwResId(pRCId));
SwAttrSet aSet(m_rDoc.GetAttrPool(), *pWhichRange); SwAttrSet aSet(m_rDoc.GetAttrPool(), *pWhichRange);