diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx index 31bcf1ebfa6a..2657c9e741ff 100644 --- a/dbaccess/source/ui/browser/sbagrid.cxx +++ b/dbaccess/source/ui/browser/sbagrid.cxx @@ -924,7 +924,7 @@ void SbaGridControl::StartDrag( sal_Int8 _nAction, const Point& _rPosPixel ) // my laziness says 'do it here'...) sal_Int32 nRow = GetRowAtYPosPixel(_rPosPixel.Y()); sal_uInt16 nColPos = GetColumnAtXPosPixel(_rPosPixel.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 bCurrentRowVirtual = IsCurrentAppending() && IsModified(); diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 6262416a480f..c76a313cc8ae 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -235,8 +235,9 @@ static std::unique_ptr lcl_GetPrintUIOptions( { sal_uInt16 nMax = nCurrentPage; const SwPageFrame *pPage = dynamic_cast(pFrame->Lower()); - while (pPage && nMax-- > 0) + while (pPage && nMax > 0) { + nMax--; if (pPage->getFrameArea().Height() == 0) nCurrentPage--; pPage = static_cast(pPage->GetNext());