summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/app/inputhdl.cxx19
-rw-r--r--sc/source/ui/view/viewdata.cxx5
2 files changed, 20 insertions, 4 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 4b6893998ca9..cc4be130d62b 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1883,8 +1883,13 @@ void ScInputHandler::UpdateActiveView()
ScDocShell* pDocShell = pActiveViewSh->GetViewData().GetDocShell();
if (comphelper::LibreOfficeKit::isActive())
{
- ScDrawLayer *pDrawLayer = pDocShell->GetDocument().GetDrawLayer();
- pTableView->registerLibreOfficeKitCallback(pDrawLayer);
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ pTableView->registerLibreOfficeKitViewCallback(pActiveViewSh);
+ else
+ {
+ ScDrawLayer *pDrawLayer = pDocShell->GetDocument().GetDrawLayer();
+ pTableView->registerLibreOfficeKitCallback(pDrawLayer);
+ }
}
}
@@ -2294,7 +2299,15 @@ void ScInputHandler::DataChanged( bool bFromTopNotify, bool bSetModified )
ScDocShell* pDocSh = pActiveViewSh->GetViewData().GetDocShell();
ScDocument& rDoc = pDocSh->GetDocument();
if ( comphelper::LibreOfficeKit::isActive() )
- rDoc.GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_CELL_FORMULA, aText.toUtf8().getStr());
+ {
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ {
+ if (pActiveViewSh)
+ pActiveViewSh->libreOfficeKitViewCallback(LOK_CALLBACK_CELL_FORMULA, aText.toUtf8().getStr());
+ }
+ else
+ rDoc.GetDrawLayer()->libreOfficeKitCallback(LOK_CALLBACK_CELL_FORMULA, aText.toUtf8().getStr());
+ }
}
// If the cursor is before the end of a paragraph, parts are being pushed to
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index aa0d3a5ec492..1a0de869e508 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -947,7 +947,10 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
if (pDoc->GetDrawLayer() && comphelper::LibreOfficeKit::isActive())
{
- pEditView[eWhich]->registerLibreOfficeKitCallback(pDoc->GetDrawLayer());
+ if (comphelper::LibreOfficeKit::isViewCallback())
+ pEditView[eWhich]->registerLibreOfficeKitViewCallback(pViewShell);
+ else
+ pEditView[eWhich]->registerLibreOfficeKitCallback(pDoc->GetDrawLayer());
}
}