editeng/source/editeng/impedit2.cxx |    4 ++--
 editeng/source/editeng/impedit3.cxx |    6 +++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

New commits:
commit 0e955c4b236bcf9e66e7b49cc3ae285f1a4a9e32
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Sep 28 21:21:25 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Sep 29 11:57:00 2024 +0200

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

diff --git a/editeng/source/editeng/impedit2.cxx 
b/editeng/source/editeng/impedit2.cxx
index e4392c73453a..91a4456989cb 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -2490,8 +2490,8 @@ EditPaM ImpEditEngine::ImpDeleteSelection(const 
EditSelection& rCurSel)
     sal_Int32 nStartNode = maEditDoc.GetPos( aStartPaM.GetNode() );
     sal_Int32 nEndNode = maEditDoc.GetPos( aEndPaM.GetNode() );
 
-    OSL_ENSURE( nEndNode != EE_PARA_NOT_FOUND, "Start > End ?!" );
-    OSL_ENSURE( nStartNode <= nEndNode, "Start > End ?!" );
+    assert( nEndNode != EE_PARA_NOT_FOUND && "Start > End ?!" );
+    assert( nStartNode <= nEndNode && "Start > End ?!" );
 
     // Remove all nodes in between...
     for ( sal_Int32 z = nStartNode+1; z < nEndNode; z++ )
commit f213fcb8c75cde4a9ea5075ac87eea6af470bbac
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Sep 28 21:40:36 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Sep 29 11:56:48 2024 +0200

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

diff --git a/editeng/source/editeng/impedit3.cxx 
b/editeng/source/editeng/impedit3.cxx
index 5993ab9a3ca0..eeb6d3a0a175 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -4383,7 +4383,11 @@ const ParaPortion* ImpEditEngine::GetPrevVisPortion( 
const ParaPortion* pCurPort
 const ParaPortion* ImpEditEngine::GetNextVisPortion( const ParaPortion* 
pCurPortion ) const
 {
     sal_Int32 nPara = GetParaPortions().GetPos( pCurPortion );
-    DBG_ASSERT( nPara < GetParaPortions().Count() , "Portion not found: 
GetPrevVisNode" );
+    if (nPara == EE_PARA_NOT_FOUND)
+    {
+        SAL_WARN("editeng", "Portion not found: GetPrevVisNode" );
+        return nullptr;
+    }
     const ParaPortion* pPortion = GetParaPortions().SafeGetObject( ++nPara );
     while ( pPortion && !pPortion->IsVisible() )
         pPortion = GetParaPortions().SafeGetObject( ++nPara );

Reply via email to