From b95059acaf33af93606d4459d5e97d5ccdfcce8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sat, 17 Aug 2024 20:49:49 +0100 Subject: [PATCH] cid#1607396 silence Overflowed integer argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I756688604ce80d0e9ca6494826767f49dcc13af1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172095 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- editeng/source/editeng/impedit2.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index b2d4a1283cff..e4392c73453a 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -1275,6 +1275,7 @@ EditPaM ImpEditEngine::CursorUp( const EditPaM& rPaM, EditView const * pView ) const ParaPortion* pPPortion = FindParaPortion( rPaM.GetNode() ); assert(pPPortion); sal_Int32 nLine = pPPortion->GetLineNumber( rPaM.GetIndex() ); + assert(nLine >= 0); const EditLine& rLine = pPPortion->GetLines()[nLine]; tools::Long nX; @@ -1289,6 +1290,7 @@ EditPaM ImpEditEngine::CursorUp( const EditPaM& rPaM, EditView const * pView ) EditPaM aNewPaM( rPaM ); if ( nLine ) // same paragraph { + assert(nLine >= 1); const EditLine& rPrevLine = pPPortion->GetLines()[nLine-1]; aNewPaM.SetIndex(GetChar(*pPPortion, rPrevLine, nX)); // If a previous automatically wrapped line, and one has to be exactly