diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-06-15 14:21:01 +0200 |
---|---|---|
committer | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2016-07-20 01:26:09 -0400 |
commit | c3ddaf3fcbc9408487a3ff247f01e95e0b59e8b3 (patch) | |
tree | 3a36542ea5f2c5049912ff0b9090b66ae3f93db8 /desktop/source | |
parent | 77f059d17de0fe0d7c048bde3c12e226b9d25d5e (diff) |
Fix per-view CppunitTest_libreofficekit_tiledrendering
Triggered by:
LOK_VIEW_CALLBACK=1 make -sr CppunitTest_libreofficekit_tiledrendering
The problem was that on shutdown SfxViewFrame::Current() returns 0 and
then SfxLokHelper::getView() should not be called (as documented by an
assert() in it).
Change-Id: If0475ca591408d5b041c1cbde5b553d0fb8dd056
Reviewed-on: https://gerrit.libreoffice.org/26300
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
(cherry picked from commit 67f2aee609308ad6d43eed4f0df084e9abd50301)
Diffstat (limited to 'desktop/source')
-rw-r--r-- | desktop/source/lib/lokinteractionhandler.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/desktop/source/lib/lokinteractionhandler.cxx b/desktop/source/lib/lokinteractionhandler.cxx index d37405b6c669..fa682589342f 100644 --- a/desktop/source/lib/lokinteractionhandler.cxx +++ b/desktop/source/lib/lokinteractionhandler.cxx @@ -40,6 +40,7 @@ #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <sfx2/lokhelper.hxx> +#include <sfx2/viewsh.hxx> #include <comphelper/lok.hxx> using namespace com::sun::star; @@ -117,8 +118,8 @@ void LOKInteractionHandler::postError(css::task::InteractionClassification class std::stringstream aStream; boost::property_tree::write_json(aStream, aTree); - std::size_t nView = comphelper::LibreOfficeKit::isViewCallback() ? SfxLokHelper::getView() : 0; - if (m_pLOKDocument && m_pLOKDocument->mpCallbackFlushHandlers[nView]) + std::size_t nView = (comphelper::LibreOfficeKit::isViewCallback() && 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) m_pLOKit->mpCallback(LOK_CALLBACK_ERROR, aStream.str().c_str(), m_pLOKit->mpCallbackData); |