diff options
-rw-r--r-- | desktop/inc/lib/init.hxx | 3 | ||||
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 3 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/view/viewsh.cxx | 3 |
4 files changed, 11 insertions, 7 deletions
diff --git a/desktop/inc/lib/init.hxx b/desktop/inc/lib/init.hxx index 2f18223793cc..815f1ac6b4da 100644 --- a/desktop/inc/lib/init.hxx +++ b/desktop/inc/lib/init.hxx @@ -30,7 +30,7 @@ namespace desktop { class DESKTOP_DLLPUBLIC CallbackFlushHandler : public Idle { public: - explicit CallbackFlushHandler(LibreOfficeKitCallback pCallback, void* pData); + explicit CallbackFlushHandler(LibreOfficeKitDocument* pDocument, LibreOfficeKitCallback pCallback, void* pData); virtual ~CallbackFlushHandler(); virtual void Invoke() override; static void callback(const int type, const char* payload, void* data); @@ -44,6 +44,7 @@ namespace desktop { std::vector<std::pair<int, std::string>> m_queue; std::map<int, std::string> m_states; + LibreOfficeKitDocument* m_pDocument; LibreOfficeKitCallback m_pCallback; void *m_pData; bool m_bPartTilePainting; diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index bdda55ea7b7d..3fd66343a424 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -1277,8 +1277,9 @@ static void callbackCompressionTest(const int type, const char* payload, void* d void DesktopLOKTest::testNotificationCompression() { + LibLODocument_Impl* pDocument = loadDoc("blank_text.odt"); std::vector<std::tuple<int, std::string>> notifs; - std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(callbackCompressionTest, ¬ifs)); + std::unique_ptr<CallbackFlushHandler> handler(new CallbackFlushHandler(pDocument, callbackCompressionTest, ¬ifs)); handler->queue(LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, ""); // 0 handler->queue(LOK_CALLBACK_TEXT_SELECTION, "15 25 15 10"); // Superseeded. diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 051362d8b739..5237d2942a4e 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -430,8 +430,9 @@ LibLODocument_Impl::~LibLODocument_Impl() mxComponent->dispose(); } -CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitCallback pCallback, void* pData) +CallbackFlushHandler::CallbackFlushHandler(LibreOfficeKitDocument* pDocument, LibreOfficeKitCallback pCallback, void* pData) : Idle( "lokit timer callback" ), + m_pDocument(pDocument), m_pCallback(pCallback), m_pData(pData), m_bPartTilePainting(false) @@ -498,6 +499,10 @@ void CallbackFlushHandler::queue(const int type, const char* data) //SAL_WARN("lokevt", "Skipping while painting [" + std::to_string(type) + "]: [" + payload + "]."); return; } + + // In Writer we drop all notifications during painting. + if (doc_getDocumentType(m_pDocument) == LOK_DOCTYPE_TEXT) + return; } // Supress invalid payloads. @@ -1338,7 +1343,7 @@ static void doc_registerCallback(LibreOfficeKitDocument* pThis, LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis); std::size_t nView = comphelper::LibreOfficeKit::isViewCallback() ? SfxLokHelper::getView() : 0; - pDocument->mpCallbackFlushHandlers[nView].reset(new CallbackFlushHandler(pCallback, pData)); + pDocument->mpCallbackFlushHandlers[nView].reset(new CallbackFlushHandler(pThis, pCallback, pData)); if (comphelper::LibreOfficeKit::isViewCallback()) { diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 832283f85ff8..6e500097c31f 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -124,9 +124,6 @@ void SwViewShell::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallbac void SwViewShell::libreOfficeKitCallback(int nType, const char* pPayload) const { - if (mbInLibreOfficeKitCallback) - return; - getIDocumentDrawModelAccess().GetDrawModel()->libreOfficeKitCallback(nType, pPayload); } |