diff options
author | Marco Cecchetti <marco.cecchetti@collabora.com> | 2016-09-10 21:02:36 +0200 |
---|---|---|
committer | Marco Cecchetti <mrcekets@gmail.com> | 2016-09-11 17:05:22 +0000 |
commit | 539f981900e1823d880f2050291b48f4c51994dd (patch) | |
tree | 4f0c23500a7b8057d5d4352eb091f6718f7f23f8 /desktop | |
parent | 956db071966dd9a7319503118c28de58015e0fca (diff) |
LOK: we use callbacks latch for not missing messages sent very early
- lok::Document::setCallbackLatch: used on document load for
set/unset the latch
- now cell cursors of other views are correctly notified to the new
view
Change-Id: Ife6dca0e3e329b801d44070f55869afe95a2f313
Reviewed-on: https://gerrit.libreoffice.org/28812
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Marco Cecchetti <mrcekets@gmail.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 0a839418c397..37a65d1e1939 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -391,7 +391,6 @@ static void doc_getDocumentSize(LibreOfficeKitDocument* pThis, long* pHeight); static void doc_initializeForRendering(LibreOfficeKitDocument* pThis, const char* pArguments); - static void doc_registerCallback(LibreOfficeKitDocument* pThis, LibreOfficeKitCallback pCallback, void* pData); @@ -443,6 +442,9 @@ static unsigned char* doc_renderFont(LibreOfficeKitDocument* pThis, int* pFontWidth, int* pFontHeight); static char* doc_getPartHash(LibreOfficeKitDocument* pThis, int nPart); +static void doc_setCallbackLatch(LibreOfficeKitDocument* pThis, + bool bCallbackLatch); + LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XComponent> &xComponent) : mxComponent(xComponent) @@ -489,6 +491,8 @@ LibLODocument_Impl::LibLODocument_Impl(const uno::Reference <css::lang::XCompone m_pDocumentClass->renderFont = doc_renderFont; m_pDocumentClass->getPartHash = doc_getPartHash; + m_pDocumentClass->setCallbackLatch = doc_setCallbackLatch; + gDocumentClass = m_pDocumentClass; } pClass = m_pDocumentClass.get(); @@ -2338,6 +2342,19 @@ unsigned char* doc_renderFont(LibreOfficeKitDocument* /*pThis*/, return nullptr; } +static void doc_setCallbackLatch(LibreOfficeKitDocument* pThis, bool bCallbackLatch) +{ + SolarMutexGuard aGuard; + LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis); + + int nView = SfxLokHelper::getView(); + if (nView < 0) + return; + + if (pDocument->mpCallbackFlushHandlers[nView]) + pDocument->mpCallbackFlushHandlers[nView]->setEventLatch(bCallbackLatch); +} + static char* lo_getError (LibreOfficeKit *pThis) { LibLibreOffice_Impl* pLib = static_cast<LibLibreOffice_Impl*>(pThis); |