diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-07-08 17:08:51 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-07-08 22:06:05 +0200 |
commit | 253d4c15e73b0a22320dbebb4bdf17f8fdb03649 (patch) | |
tree | a96a542924a3d02c5607fa05fd7156e3bf017a67 /vcl/source/edit | |
parent | 94f4bdb910a9db49016ea23cd0086f70a1468363 (diff) |
query if the cursor can be moved up or down
Change-Id: I47c09ff5f76c873cf30e608a134f90b42040a0c3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98387
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/edit')
-rw-r--r-- | vcl/source/edit/vclmedit.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vcl/source/edit/vclmedit.cxx b/vcl/source/edit/vclmedit.cxx index 021ef7658837..fe459ba59a0d 100644 --- a/vcl/source/edit/vclmedit.cxx +++ b/vcl/source/edit/vclmedit.cxx @@ -1515,6 +1515,22 @@ void VclMultiLineEdit::EnableCursor( bool bEnable ) GetTextView()->EnableCursor( bEnable ); } +bool VclMultiLineEdit::CanUp() const +{ + TextView* pTextView = GetTextView(); + const TextSelection& rTextSelection = pTextView->GetSelection(); + TextPaM aPaM(rTextSelection.GetEnd()); + return aPaM != pTextView->CursorUp(aPaM); +} + +bool VclMultiLineEdit::CanDown() const +{ + TextView* pTextView = GetTextView(); + const TextSelection& rTextSelection = pTextView->GetSelection(); + TextPaM aPaM(rTextSelection.GetEnd()); + return aPaM != pTextView->CursorDown(aPaM); +} + TextWindow* VclMultiLineEdit::GetTextWindow() { return pImpVclMEdit->GetTextWindow(); |