sd/source/ui/view/outlview.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 4ff5a7b810d293e3d9d457049145ef5c3b1d95d0
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Sep 28 15:16:19 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Sep 28 20:09:48 2024 +0200

    cid#1607680 Overflowed constant
    
    Change-Id: I8522cfe5422c187b9045858c2f94753d0f2c8714
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174123
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index 07c55d7c3ee7..33d8f78ba3c5 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -1176,7 +1176,9 @@ Paragraph* OutlineView::GetParagraphForPage( ::Outliner 
const & rOutl, SdPage co
 {
     // get the number of paragraphs with ident 0 we need to skip before
     // we find the actual page
-    sal_uInt32 nPagesToSkip = (pPage->GetPageNum() - 1) >> 1;
+    sal_uInt16 nPageNum = pPage->GetPageNum();
+    assert(nPageNum > 0);
+    sal_uInt32 nPagesToSkip = (nPageNum - 1) >> 1;
 
     sal_Int32 nParaPos = 0;
     Paragraph* pPara = rOutl.GetParagraph( 0 );

Reply via email to