Kaydet (Commit) c1b4de9d authored tarafından Miklos Vajna's avatar Miklos Vajna

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/26260Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst c63125f8
......@@ -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
......
......@@ -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());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment