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

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/26300Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 7e62c8c9
......@@ -39,6 +39,7 @@
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <sfx2/lokhelper.hxx>
#include <sfx2/viewsh.hxx>
#include <comphelper/lok.hxx>
using namespace com::sun::star;
......@@ -116,8 +117,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);
......
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