Simplify SfxBindings::ExecuteSynchron

... by making SfxBindings::Execute return SfxPoolItemHolder.

Change-Id: Idd62a5eae791a6a4fec283c0c80fdac19c3526d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180982
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Mike Kaganski
2025-01-31 14:23:13 +05:00
parent e6d50480a1
commit c9c2d46acf
5 changed files with 10 additions and 12 deletions

View File

@@ -158,7 +158,7 @@ public:
SfxPoolItemHolder ExecuteSynchron( sal_uInt16 nSlot,
const SfxPoolItem **pArgs = nullptr);
bool Execute( sal_uInt16 nSlot,
SfxPoolItemHolder Execute( sal_uInt16 nSlot,
const SfxPoolItem **pArgs = nullptr,
SfxCallMode nCall = SfxCallMode::SLOT);

View File

@@ -26,6 +26,7 @@
#include <comphelper/string.hxx>
#include <cppuhelper/implbase.hxx>
#include <sal/log.hxx>
#include <svl/itemset.hxx>
#include <tools/debug.hxx>
#include <vcl/svapp.hxx>

View File

@@ -863,20 +863,16 @@ void SfxBindings::Release( SfxControllerItem& rItem )
SfxPoolItemHolder SfxBindings::ExecuteSynchron( sal_uInt16 nId, const SfxPoolItem** ppItems )
{
return Execute(nId, ppItems, SfxCallMode::SYNCHRON);
}
SfxPoolItemHolder SfxBindings::Execute( sal_uInt16 nId, const SfxPoolItem** ppItems, SfxCallMode nCallMode )
{
if( !nId || !pDispatcher )
return SfxPoolItemHolder();
return Execute_Impl(nId, ppItems, SfxCallMode::SYNCHRON);
}
bool SfxBindings::Execute( sal_uInt16 nId, const SfxPoolItem** ppItems, SfxCallMode nCallMode )
{
if( !nId || !pDispatcher )
return false;
const SfxPoolItemHolder aRet(Execute_Impl(nId, ppItems, nCallMode));
return aRet.is();
return Execute_Impl(nId, ppItems, nCallMode);
}
SfxPoolItemHolder SfxBindings::Execute_Impl( sal_uInt16 nId, const SfxPoolItem** ppItems, SfxCallMode nCallMode )

View File

@@ -3942,7 +3942,7 @@ bool SfxViewShell::HasMouseClickListeners_Impl() const
bool SfxViewShell::Escape()
{
return GetViewFrame().GetBindings().Execute(SID_TERMINATE_INPLACEACTIVATION);
return GetViewFrame().GetBindings().Execute(SID_TERMINATE_INPLACEACTIVATION).is();
}
Reference< view::XRenderable > SfxViewShell::GetRenderable()

View File

@@ -21,6 +21,7 @@
#include <tabwin.hxx>
#include <fmservs.hxx>
#include <svl/itemset.hxx>
#include <svx/strings.hrc>
#include <svx/svxids.hrc>
#include <com/sun/star/sdb/CommandType.hpp>