cid#1607396 silence Overflowed integer argument

Change-Id: I756688604ce80d0e9ca6494826767f49dcc13af1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172095
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
This commit is contained in:
Caolán McNamara 2024-08-17 20:49:49 +01:00
parent edb352c241
commit b95059acaf

View file

@ -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