sc/source/ui/app/inputhdl.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
New commits: commit 3c60b9cced6d5deebc1ca46933d3e3dbac923675 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Thu Mar 19 13:54:18 2020 +0100 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Mon May 25 09:36:24 2020 +0200 Fix sending reference marks for current selection When selecting range on mobile in validation dialog the message wasn't sent due to missing ViewShell Change-Id: Iaab543368469cd363b54b1a89f6983b8c01877ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94693 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 68e2f780fc14..b8d126c936b7 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -465,10 +465,16 @@ ReferenceMark ScInputHandler::GetReferenceMark( ScViewData& rViewData, ScDocShel void ScInputHandler::UpdateLokReferenceMarks() { - if ( !comphelper::LibreOfficeKit::isActive() || !pActiveViewSh ) + if ( !comphelper::LibreOfficeKit::isActive()) return; - ScViewData& rViewData = pActiveViewSh->GetViewData(); + ScTabViewShell* pShell = pActiveViewSh ? pActiveViewSh + : dynamic_cast<ScTabViewShell*>(SfxViewShell::Current()); + + if (!pShell) + return; + + ScViewData& rViewData = pShell->GetViewData(); ScDocShell* pDocSh = rViewData.GetDocShell(); ScRangeFindList* pRangeFinder = GetRangeFindList(); @@ -521,18 +527,18 @@ void ScInputHandler::UpdateLokReferenceMarks() nX1, nX2, nY1, nY2, nTab, Color( rData.nColor ) ); - ScInputHandler::SendReferenceMarks( pActiveViewSh, aReferenceMarks ); + ScInputHandler::SendReferenceMarks( pShell, aReferenceMarks ); } } else if ( nCount ) { - ScInputHandler::SendReferenceMarks( pActiveViewSh, aReferenceMarks ); + ScInputHandler::SendReferenceMarks( pShell, aReferenceMarks ); } else { // Clear aReferenceMarks.clear(); - ScInputHandler::SendReferenceMarks( pActiveViewSh, aReferenceMarks ); + ScInputHandler::SendReferenceMarks( pShell, aReferenceMarks ); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits