diff options
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/README.vars | 1 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 27 | ||||
-rw-r--r-- | desktop/source/lib/lokinteractionhandler.cxx | 2 |
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) |