summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sd/source/ui/slideshow/slideshowimpl.cxx4
-rw-r--r--sd/source/ui/view/viewshe2.cxx4
-rw-r--r--sw/source/core/table/swtable.cxx2
3 files changed, 6 insertions, 4 deletions
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx
index b18e0e804ed1..696c81bf4974 100644
--- a/sd/source/ui/slideshow/slideshowimpl.cxx
+++ b/sd/source/ui/slideshow/slideshowimpl.cxx
@@ -1084,7 +1084,9 @@ bool SlideshowImpl::startShow( PresentationSettingsEx const * pPresSettings )
{
// we are in notes page mode, so get
// the corresponding draw page
- const sal_uInt16 nPgNum = ( pStartPage->GetPageNum() - 2 ) >> 1;
+ const sal_uInt16 nNotePgNum = pStartPage->GetPageNum();
+ assert(nNotePgNum >= 2);
+ const sal_uInt16 nPgNum = ( nNotePgNum - 2 ) >> 1;
pStartPage = mpDoc->GetSdPage( nPgNum, PageKind::Standard );
}
}
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index 71c152461286..0e0b52c5dd0b 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -255,7 +255,7 @@ void ViewShell::VirtVScrollHdl(ScrollAdaptor* pVScroll)
if (CanPanAcrossPages())
{
SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage();
- sal_uInt16 nCurPage = (pPage->GetPageNum() - 1) >> 1;
+ auto nCurPage = (pPage->GetPageNum() - 1) >> 1;
sal_uInt16 nTotalPages = GetDoc()->GetSdPageCount(pPage->GetPageKind());
double fVisibleHeight = mpContentWindow->GetVisibleHeight();
@@ -279,7 +279,7 @@ void ViewShell::VirtVScrollHdl(ScrollAdaptor* pVScroll)
else if (IsPageFlipMode())
{
SdPage* pPage = static_cast<DrawViewShell*>(this)->GetActualPage();
- sal_uInt16 nCurPage = (pPage->GetPageNum() - 1) >> 1;
+ auto nCurPage = (pPage->GetPageNum() - 1) >> 1;
sal_uInt16 nNewPage = static_cast<sal_uInt16>(pVScroll->GetThumbPos())/256;
if( nCurPage != nNewPage )
static_cast<DrawViewShell*>(this)->SwitchPage(nNewPage);
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 8fb34eb88f6b..0b91e902413a 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -1210,7 +1210,7 @@ void SwTable::NewSetTabCols( Parm &rParm, const SwTabCols &rNew,
ColChange aChg( 0, 0 );
aOldNew.push_front( aChg );
std::vector<sal_uInt16> aRowSpanPos;
- if( nCurr )
+ if (nCurr > 0)
{
ChangeList aCopy;
sal_uInt16 nPos = 0;