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

New commits:
commit d6752e02e3870875ced86adc04aae8e36a12cf0c
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 09:48:20 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>

diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 7b8b7283b415..4ea06231562a 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -898,9 +898,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