diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-14 14:15:02 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-14 13:06:17 +0000 |
commit | c1b4de9d8b480d0a773f4bf6bfc5f752f47c32f0 (patch) | |
tree | 9ea5d4e2131bc38f9abdc84eca6c966b1a6fbb21 /sc | |
parent | c63125f88bf90d33f6fd48964422c3b0633d027d (diff) |
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 <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 19 | ||||
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 5 |
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()); } } |