sc/source/ui/view/gridwin.cxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
New commits: commit ff69401d8c941e5adaa662da81c6f02d9fe71955 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Nov 2 09:20:31 2020 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Mon Nov 2 12:40:42 2020 +0100 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_l...@sil.org> Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Jenkins 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); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits