diff options
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/viewshe2.cxx | 4 |
2 files changed, 5 insertions, 3 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); |