desktop/source/lib/lokinteractionhandler.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 67f2aee609308ad6d43eed4f0df084e9abd50301
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Wed Jun 15 14:21:01 2016 +0200

    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 <vmik...@collabora.co.uk>
    Tested-by: Jenkins <c...@libreoffice.org>

diff --git a/desktop/source/lib/lokinteractionhandler.cxx 
b/desktop/source/lib/lokinteractionhandler.cxx
index 76a7e84..0a7687e 100644
--- a/desktop/source/lib/lokinteractionhandler.cxx
+++ b/desktop/source/lib/lokinteractionhandler.cxx
@@ -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);
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to