sfx2/source/control/bindings.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6efbf1ee6d6f1160ec7003b4574b4f7abe59287b
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Fri Jun 3 10:56:44 2022 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Mon Jun 6 10:00:56 2022 +0200

    make SfxStateCache::xDispatch up to date before using it
    
    When e.g. having one image selected and then double-clicking on
    the other one Execute_Impl() gets called with SfxStateCache still
    having bSlotDirt and mxDispatch out of date.
    I originally tried to make all mxDispatch accesses first ensure
    !bSlotDirty, but then unit tests started failing with hard-to-debug
    crashes because GetSlotServer() also sets bCtrlDirty, which leads
    SfxBindings to handle that in idle timers. So at least handle this
    case, where it really is necessary.
    
    Change-Id: I4ec5908bc955c562e14cd813e269536924ce6f2b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135344
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>
    (cherry picked from commit d6752e02e3870875ced86adc04aae8e36a12cf0c)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135376
    Tested-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 1baa03845ea0..68d5c0efd9a4 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -900,9 +900,9 @@ const SfxPoolItem* SfxBindings::Execute_Impl( sal_uInt16 
nId, const SfxPoolItem*
         // slot is uncached, use SlotCache to handle external dispatch 
providers
         xCache.reset(new SfxStateCache(nId));
         pCache = xCache.get();
-        pCache->GetSlotServer( rDispatcher, pImpl->xProv );
     }
 
+    pCache->GetSlotServer( rDispatcher, pImpl->xProv ); // make 
pCache->GetDispatch() up to date
     if ( pCache->GetDispatch().is() )
     {
         DBG_ASSERT( !ppInternalArgs, "Internal args get lost when dispatched!" 
);

Reply via email to