diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-11-02 09:20:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-11-02 12:40:42 +0100 |
commit | ff69401d8c941e5adaa662da81c6f02d9fe71955 (patch) | |
tree | 8d5af3fa91476eb516a1299c0ac984e88f6a8ec8 | |
parent | fcfa40fabb2943d7cb1adfe0057c715e225daef9 (diff) |
tdf#137620 support surrounding text for calc comments
Change-Id: I362a8ec6cd5de8602863fd2e520c8bd1a3706f00
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105171
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Jenkins
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index c3815041f3eb..c5274ec4c23b 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -3358,6 +3358,13 @@ OUString ScGridWindow::GetSurroundingText() const if (pHdl) return pHdl->GetSurroundingText(); } + else if (SdrView* pSdrView = mrViewData.GetView()->GetScDrawView()) + { + // if no cell editview is active, look at drawview + OutlinerView* pOlView = pSdrView->GetTextEditOutlinerView(); + if (pOlView && pOlView->GetWindow() == this) + return pOlView->GetSurroundingText(); + } return Window::GetSurroundingText(); } @@ -3372,6 +3379,13 @@ Selection ScGridWindow::GetSurroundingTextSelection() const if (pHdl) return pHdl->GetSurroundingTextSelection(); } + else if (SdrView* pSdrView = mrViewData.GetView()->GetScDrawView()) + { + // if no cell editview is active, look at drawview + OutlinerView* pOlView = pSdrView->GetTextEditOutlinerView(); + if (pOlView && pOlView->GetWindow() == this) + return pOlView->GetSurroundingTextSelection(); + } return Window::GetSurroundingTextSelection(); } @@ -3386,6 +3400,13 @@ bool ScGridWindow::DeleteSurroundingText(const Selection& rSelection) if (pHdl) return pHdl->DeleteSurroundingText(rSelection); } + else if (SdrView* pSdrView = mrViewData.GetView()->GetScDrawView()) + { + // if no cell editview is active, look at drawview + OutlinerView* pOlView = pSdrView->GetTextEditOutlinerView(); + if (pOlView && pOlView->GetWindow() == this) + return pOlView->DeleteSurroundingText(rSelection); + } return Window::DeleteSurroundingText(rSelection); } |