[Libreoffice-commits] core.git: sc/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Jun 14 13:06:45 UTC 2016
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 <vmiklos at collabora.co.uk>
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 <vmiklos at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
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());
}
}
More information about the Libreoffice-commits
mailing list