summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/app/inputhdl.cxx16
1 files changed, 11 insertions, 5 deletions
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 );
}
}