summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-17 11:45:02 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-06-17 12:47:46 +0000
commit5b5706f41f97998785e1e7ad356580772da80c42 (patch)
tree90fbc80386ed79b12bd5fce299c7a139384d9e0b /desktop
parente30f3bcd25762236eb739584dc71691123527c9f (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>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/README.vars1
-rw-r--r--desktop/source/lib/init.cxx27
-rw-r--r--desktop/source/lib/lokinteractionhandler.cxx2
3 files changed, 6 insertions, 24 deletions
diff --git a/desktop/README.vars b/desktop/README.vars
index 39e3aaa20436..67c605698110 100644
--- a/desktop/README.vars
+++ b/desktop/README.vars
@@ -13,4 +13,3 @@ LibreOfficeKit
--------------
LOK_DEBUG - Draw a small red rectangle in the top left corner so that it's easy to see where a new tile begins.
-LOK_MODEL_CALLBACK - Use old document-global callback instead of multiple per-view ones.
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index bd31b9b54e2a..a0aebeed4fe7 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1342,25 +1342,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)
@@ -1441,7 +1427,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma
bool bResult = false;
- std::size_t nView = comphelper::LibreOfficeKit::isViewCallback() ? SfxLokHelper::getView() : 0;
+ std::size_t nView = SfxLokHelper::getView();
if (bNotifyWhenFinished && pDocument->mpCallbackFlushHandlers[nView])
{
bResult = comphelper::dispatchCommand(aCommand, comphelper::containerToSequence(aPropertyValuesVector),
@@ -1477,7 +1463,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());
@@ -2136,9 +2122,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 0a7687e05730..eaf96ab1ad5d 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -117,7 +117,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)