diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 11:48:25 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-07 11:48:25 +0000 |
commit | 9c0049cfae49c8e4ddef9125a69db2ad134c10c6 (patch) | |
tree | 812a86c0eee63dfc5ace12f2622ed3ce9cd3d680 /sfx2/source/control | |
parent | Releasing progress-linux version 4:24.2.3-2~progress7.99u1. (diff) | |
download | libreoffice-9c0049cfae49c8e4ddef9125a69db2ad134c10c6.tar.xz libreoffice-9c0049cfae49c8e4ddef9125a69db2ad134c10c6.zip |
Merging upstream version 4:24.2.4.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sfx2/source/control')
-rw-r--r-- | sfx2/source/control/bindings.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/control/dispatch.cxx | 16 |
2 files changed, 12 insertions, 7 deletions
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx index 47ddda2813..8beca9364e 100644 --- a/sfx2/source/control/bindings.cxx +++ b/sfx2/source/control/bindings.cxx @@ -945,6 +945,9 @@ SfxPoolItemHolder SfxBindings::Execute_Impl( sal_uInt16 nId, const SfxPoolItem** if ( dynamic_cast< const SfxModule *>( pShell ) == nullptr && dynamic_cast< const SfxApplication *>( pShell ) == nullptr && dynamic_cast< const SfxViewFrame *>( pShell ) == nullptr ) return SfxPoolItemHolder(); + if (!pShell) + return SfxPoolItemHolder(); + SfxItemPool &rPool = pShell->GetPool(); SfxRequest aReq( nId, nCallMode, rPool ); aReq.SetModifier( nModi ); diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index fe7271677f..bedad9a624 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -707,7 +707,7 @@ bool SfxDispatcher::GetShellAndSlot_Impl(sal_uInt16 nSlot, SfxShell** ppShell, *ppShell = GetShell(aSvr.GetShellLevel()); *ppSlot = aSvr.GetSlot(); - if ( nullptr == (*ppSlot)->GetExecFnc() && bRealSlot ) + if ( nullptr == (*ppSlot)->GetExecFnc() && bRealSlot && *ppShell ) *ppSlot = (*ppShell)->GetInterface()->GetRealSlot(*ppSlot); // Check only real slots as enum slots don't have an execute function! return !bRealSlot || ((nullptr != *ppSlot) && (nullptr != (*ppSlot)->GetExecFnc()) ); @@ -986,13 +986,15 @@ void SfxDispatcher::PostMsgHandler(std::unique_ptr<SfxRequest> pReq) SfxSlotServer aSvr; if ( FindServer_(pReq->GetSlot(), aSvr ) ) // HACK(x), whatever that was supposed to mean { - const SfxSlot *pSlot = aSvr.GetSlot(); - SfxShell *pSh = GetShell(aSvr.GetShellLevel()); + if (SfxShell *pSh = GetShell(aSvr.GetShellLevel())) + { + const SfxSlot *pSlot = aSvr.GetSlot(); - // When the pSlot is a "Pseudoslot" for macros or Verbs, it can - // be destroyed in the Call_Impl, thus do not use it anymore! - pReq->SetSynchronCall( false ); - Call_Impl( *pSh, *pSlot, *pReq, pReq->AllowsRecording() ); //! why bRecord? + // When the pSlot is a "Pseudoslot" for macros or Verbs, it can + // be destroyed in the Call_Impl, thus do not use it anymore! + pReq->SetSynchronCall( false ); + Call_Impl( *pSh, *pSlot, *pReq, pReq->AllowsRecording() ); //! why bRecord? + } } } else |