Skip to content

Commit

Permalink
tdf#81226: Cursor jumping fixed
Browse files Browse the repository at this point in the history
Cursor to jump to end of line when pressing the down key

Change-Id: Ib9548d02039a17257ac7ed63221952abb7792590
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89533
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
  • Loading branch information
Canberk TURAN authored and GulsahKose committed Feb 27, 2020
1 parent b112932 commit 0aa0fda
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sw/source/core/crsr/swcrsr.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2024,11 +2024,17 @@ bool SwCursor::UpDown( bool bUp, sal_uInt16 nCnt,
}
pFrame->GetModelPositionForViewPoint( GetPoint(), aPt, &eTmpState );
}
bRet = !IsSelOvr( SwCursorSelOverFlags::Toggle | SwCursorSelOverFlags::ChangePos );
}
else
*GetPoint() = aOldPos;
{
// Jump to beginning or end of line when the cursor at first or last line.
SwNode& rNode = GetPoint()->nNode.GetNode();
const sal_Int32 nOffset = bUp ? 0 : rNode.GetTextNode()->GetText().getLength();
const SwPosition aPos(*GetContentNode(), nOffset);
*GetPoint() = aPos;
}

bRet = !IsSelOvr( SwCursorSelOverFlags::Toggle | SwCursorSelOverFlags::ChangePos );
DoSetBidiLevelUpDown(); // calculate cursor bidi level
}
return bRet;
Expand Down

0 comments on commit 0aa0fda

Please sign in to comment.