summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-17 11:45:02 +0200
committerAshod Nakashian <ashod.nakashian@collabora.co.uk>2016-07-20 01:33:09 -0400
commit2a03b0e6fe09ba8ce02977d50814800e720b8d46 (patch)
treee623bffcb0793a320a414fa537e7519c3976d96f /desktop/source
parentb91d37bcab9a6ab734c96b9e0ca59c49a75e0ed2 (diff)
comphelper lok: remove the g_bViewCallback global
Its purpose was to allow incrementally migrate all callers of SdrModel::libreOfficeKitCallback() to use SfxViewShell::libreOfficeKitViewCallback() (which allows notifying only the currently active or all views) instead. That is done by now, so it can go. Change-Id: I521bbbe5c638dfd844ebf025153459a37362d3c3 Reviewed-on: https://gerrit.libreoffice.org/26413 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 5b5706f41f97998785e1e7ad356580772da80c42)
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/lib/init.cxx27
-rw-r--r--desktop/source/lib/lokinteractionhandler.cxx2
2 files changed, 7 insertions, 22 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 8a1a2f780093..48db0ec73d7a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1394,25 +1394,11 @@ static void doc_registerCallback(LibreOfficeKitDocument* pThis,
SolarMutexGuard aGuard;
LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
- std::size_t nView = comphelper::LibreOfficeKit::isViewCallback() ? SfxLokHelper::getView() : 0;
+ std::size_t nView = SfxLokHelper::getView();
pDocument->mpCallbackFlushHandlers[nView].reset(new CallbackFlushHandler(pThis, pCallback, pData));
- if (comphelper::LibreOfficeKit::isViewCallback())
- {
- if (SfxViewShell* pViewShell = SfxViewFrame::Current()->GetViewShell())
- pViewShell->registerLibreOfficeKitViewCallback(CallbackFlushHandler::callback, pDocument->mpCallbackFlushHandlers[nView].get());
- }
- else
- {
- ITiledRenderable* pDoc = getTiledRenderable(pThis);
- if (!pDoc)
- {
- gImpl->maLastExceptionMsg = "Document doesn't support tiled rendering";
- return;
- }
-
- pDoc->registerCallback(CallbackFlushHandler::callback, pDocument->mpCallbackFlushHandlers[nView].get());
- }
+ if (SfxViewShell* pViewShell = SfxViewFrame::Current()->GetViewShell())
+ pViewShell->registerLibreOfficeKitViewCallback(CallbackFlushHandler::callback, pDocument->mpCallbackFlushHandlers[nView].get());
}
static void doc_postKeyEvent(LibreOfficeKitDocument* pThis, int nType, int nCharCode, int nKeyCode)
@@ -1527,6 +1513,8 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
}
bool bResult = false;
+
+ std::size_t nView = SfxLokHelper::getView();
if (bNotifyWhenFinished && pDocument->mpCallbackFlushHandlers[nView])
{
bResult = comphelper::dispatchCommand(aCommand, comphelper::containerToSequence(aPropertyValuesVector),
@@ -1562,7 +1550,7 @@ static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX,
}
LibLODocument_Impl* pLib = static_cast<LibLODocument_Impl*>(pThis);
- std::size_t nView = comphelper::LibreOfficeKit::isViewCallback() ? SfxLokHelper::getView() : 0;
+ std::size_t nView = SfxLokHelper::getView();
if (pLib->mpCallbackFlushHandlers[nView])
{
pLib->mpCallbackFlushHandlers[nView]->queue(LOK_CALLBACK_MOUSE_POINTER, aPointerString.getStr());
@@ -2239,9 +2227,6 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char
if (eStage != SECOND_INIT)
comphelper::LibreOfficeKit::setActive();
- static bool bViewCallback = !getenv("LOK_MODEL_CALLBACK");
- comphelper::LibreOfficeKit::setViewCallback(bViewCallback);
-
if (eStage != PRE_INIT)
comphelper::LibreOfficeKit::setStatusIndicatorCallback(lo_status_indicator_callback, pLib);
diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx
index fa682589342f..961c999522b5 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -118,7 +118,7 @@ void LOKInteractionHandler::postError(css::task::InteractionClassification class
std::stringstream aStream;
boost::property_tree::write_json(aStream, aTree);
- std::size_t nView = (comphelper::LibreOfficeKit::isViewCallback() && SfxViewShell::Current()) ? SfxLokHelper::getView() : 0;
+ std::size_t nView = SfxViewShell::Current() ? SfxLokHelper::getView() : 0;
if (m_pLOKDocument && m_pLOKDocument->mpCallbackFlushHandlers.size() > nView && m_pLOKDocument->mpCallbackFlushHandlers[nView])
m_pLOKDocument->mpCallbackFlushHandlers[nView]->queue(LOK_CALLBACK_ERROR, aStream.str().c_str());
else if (m_pLOKit->mpCallback)