diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2019-12-04 08:19:22 -0500 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-12-16 17:30:01 +0000 |
commit | f60f04cacf403aaeac67dea5861ca3fd2bbaa76b (patch) | |
tree | 5e5b004a631d00bef667ed6d5c4618f8541a9f26 /desktop | |
parent | 7193fa3f6782f843b5a9adf1d22172f2e85551fe (diff) |
LOK: don't send LOK notifications while switching views
Changing the active view is done for virtually every
LOK API, and in some cases simply changing the view
results in a flurry of notifications that themselves
caues further API calls that need to change the view.
This moves the disabling of callbacks during setView
to SfxLokHelper to make sure no view gets any
notifications. This is needed because even when
we disable notifications for the current view,
the _other_ view(s) can still get notified as they
lose their frame.
Change-Id: Ia88a58d6a1162e48c40f4c4ce73c40ecb2c1fb7e
Reviewed-on: https://gerrit.libreoffice.org/84417
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/lib/init.cxx | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 68b75b3d181c..81c02c2c5d22 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4634,28 +4634,14 @@ static void doc_destroyView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis SfxLokHelper::destroyView(nId); } -static void doc_setView(LibreOfficeKitDocument* pThis, int nId) +static void doc_setView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/, int nId) { comphelper::ProfileZone aZone("doc_setView"); SolarMutexGuard aGuard; SetLastExceptionMsg(); - LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis); - const auto handlerIt = pDocument->mpCallbackFlushHandlers.find(nId); - if (handlerIt != pDocument->mpCallbackFlushHandlers.end()) - handlerIt->second->disableCallbacks(); - - try - { - SfxLokHelper::setView(nId); - } - catch (const std::exception&) - { - } - - if (handlerIt != pDocument->mpCallbackFlushHandlers.end()) - handlerIt->second->enableCallbacks(); + SfxLokHelper::setView(nId); } static int doc_getView(SAL_UNUSED_PARAMETER LibreOfficeKitDocument* /*pThis*/) |