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((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);