sc/source/ui/app/inputhdl.cxx | 19 ++++++++++++++++--- sc/source/ui/view/viewdata.cxx | 5 ++++- 2 files changed, 20 insertions(+), 4 deletions(-)
New commits: commit c1b4de9d8b480d0a773f4bf6bfc5f752f47c32f0 Author: Miklos Vajna <[email protected]> Date: Tue Jun 14 14:15:02 2016 +0200 sc: implement per-view LOK_CALLBACK_CELL_FORMULA With this, one view can edit one cell while the other view edits an other cell within the same sheet (without a failing assert). Change-Id: I355caea69daa17fcd4b4813d0f31ff2072f9c847 Reviewed-on: https://gerrit.libreoffice.org/26260 Reviewed-by: Miklos Vajna <[email protected]> Tested-by: Jenkins <[email protected]> diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 4b68939..cc4be13 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 aa0d3a5..1a0de86 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()); } } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
