diff options
Diffstat (limited to 'desktop/source/lib/init.cxx')
-rw-r--r-- | desktop/source/lib/init.cxx | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 616521dfc946..b32792cdca4b 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1335,7 +1335,10 @@ void doc_paintPartTile(LibreOfficeKitDocument* pThis, // Disable callbacks while we are painting. LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis); - std::size_t nView = SfxLokHelper::getView(); + int nView = SfxLokHelper::getView(); + if (nView < 0) + return; + pDocument->mpCallbackFlushHandlers[nView]->setPartTilePainting(true); try { @@ -1408,7 +1411,10 @@ static void doc_registerCallback(LibreOfficeKitDocument* pThis, SolarMutexGuard aGuard; LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis); - std::size_t nView = SfxLokHelper::getView(); + int nView = SfxLokHelper::getView(); + if (nView < 0) + return; + pDocument->mpCallbackFlushHandlers[nView].reset(new CallbackFlushHandler(pThis, pCallback, pData)); if (SfxViewShell* pViewShell = SfxViewFrame::Current()->GetViewShell()) @@ -1477,7 +1483,9 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis); std::vector<beans::PropertyValue> aPropertyValuesVector(jsonToPropertyValuesVector(pArguments)); - std::size_t nView = SfxLokHelper::getView(); + int nView = SfxLokHelper::getView(); + if (nView < 0) + return; // handle potential interaction if (gImpl && aCommand == ".uno:Save") @@ -1562,7 +1570,10 @@ static void doc_postMouseEvent(LibreOfficeKitDocument* pThis, int nType, int nX, } LibLODocument_Impl* pLib = static_cast<LibLODocument_Impl*>(pThis); - std::size_t nView = SfxLokHelper::getView(); + int nView = SfxLokHelper::getView(); + if (nView < 0) + return; + if (pLib->mpCallbackFlushHandlers[nView]) { pLib->mpCallbackFlushHandlers[nView]->queue(LOK_CALLBACK_MOUSE_POINTER, aPointerString.getStr()); |