sd/source/ui/slideshow/slideshowimpl.cxx |    4 +++-
 sd/source/ui/view/viewshe2.cxx           |    4 ++--
 sw/source/core/table/swtable.cxx         |    2 +-
 3 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 54f47ae4eb13d5342f7ef48ddf7ead5f792544d0
Author:     Caolán McNamara <[email protected]>
AuthorDate: Thu Oct 17 09:04:42 2024 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sat Oct 19 14:48:58 2024 +0200

    cid#1608219 silence Overflowed constant
    
    and
    
    cid#1608307 Overflowed constant
    cid#1606687 Overflowed integer argument
    
    Change-Id: I043f3e49810ca441453af88866a1156f47e6cd87
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175177
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins

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;

Reply via email to