From 253d4c15e73b0a22320dbebb4bdf17f8fdb03649 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 8 Jul 2020 17:08:51 +0100 Subject: query if the cursor can be moved up or down MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I47c09ff5f76c873cf30e608a134f90b42040a0c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98387 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/source/edit/vclmedit.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'vcl/source/edit') 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(); -- cgit