diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-10-27 16:49:48 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-10-28 10:04:43 +0100 |
commit | 8dcbbea3802670004c3e78a1ff1ec56b23df674c (patch) | |
tree | b9ae1e0d35496f70fdc9add7c871202e490190f6 /starmath | |
parent | 585f8dacba798afde6b4cc439c969a37a37e6162 (diff) |
tdf#137620 add explicit SurroundingText support to starmath Edit Window
Change-Id: Ie716dd66754dd774ee81fa97ebee8dc314002f12
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104898
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/edit.hxx | 4 | ||||
-rw-r--r-- | starmath/source/edit.cxx | 21 |
2 files changed, 25 insertions, 0 deletions
diff --git a/starmath/inc/edit.hxx b/starmath/inc/edit.hxx index c1ce769ab1c6..43ef648ddd95 100644 --- a/starmath/inc/edit.hxx +++ b/starmath/inc/edit.hxx @@ -68,6 +68,10 @@ class SmEditWindow final : public vcl::Window, public DropTargetHelper virtual void MouseButtonUp(const MouseEvent &rEvt) override; virtual void MouseButtonDown(const MouseEvent &rEvt) override; + virtual OUString GetSurroundingText() const override; + virtual Selection GetSurroundingTextSelection() const override; + virtual bool DeleteSurroundingText(const Selection& rSelection) override; + virtual sal_Int8 AcceptDrop( const AcceptDropEvent& rEvt ) override; virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ) override; virtual void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) override; diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index c8f82355468e..ef1da5bca1ab 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -144,6 +144,27 @@ void SmEditWindow::dispose() vcl::Window::dispose(); } +OUString SmEditWindow::GetSurroundingText() const +{ + if (pEditView) + return pEditView->GetSurroundingText(); + return OUString(); +} + +Selection SmEditWindow::GetSurroundingTextSelection() const +{ + if (pEditView) + return pEditView->GetSurroundingTextSelection(); + return Selection(0, 0); +} + +bool SmEditWindow::DeleteSurroundingText(const Selection& rSelection) +{ + if (pEditView) + return pEditView->DeleteSurroundingText(rSelection); + return false; +} + void SmEditWindow::StartCursorMove() { if (!IsInlineEditEnabled()) |