include/sfx2/request.hxx | 5 ++--- sfx2/source/control/request.cxx | 3 +-- svx/source/form/fmundo.cxx | 22 +++++++++++----------- 3 files changed, 14 insertions(+), 16 deletions(-)
New commits: commit e0f85bc22df4119101d854efaf53c7dd568f944c Author: Caolán McNamara <[email protected]> AuthorDate: Sat Oct 7 18:55:09 2023 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Sun Oct 8 13:17:38 2023 +0200 SfxRequest doesn't need to inherit from SfxHint or anything Change-Id: Ibfedb7dce6503b5593111380c53fc0ef6c7e93af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157680 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/include/sfx2/request.hxx b/include/sfx2/request.hxx index 908f98b55379..5c7db9925560 100644 --- a/include/sfx2/request.hxx +++ b/include/sfx2/request.hxx @@ -23,7 +23,6 @@ #include <sfx2/dllapi.h> #include <sal/types.h> #include <svl/itemset.hxx> -#include <svl/hint.hxx> #include <memory> @@ -40,7 +39,7 @@ namespace com::sun::star::frame { class XDispatchRecorder; } namespace com::sun::star::uno { template <class E> class Sequence; } namespace weld { class Window; } -class SFX2_DLLPUBLIC SfxRequest final : public SfxHint +class SFX2_DLLPUBLIC SfxRequest final { friend struct SfxRequest_Impl; @@ -63,7 +62,7 @@ public: SfxRequest(sal_uInt16 nSlot, SfxCallMode nCallMode, const SfxAllItemSet& rSfxArgs); SfxRequest( sal_uInt16 nSlot, SfxCallMode nCallMode, const SfxAllItemSet& rSfxArgs, const SfxAllItemSet& rSfxInternalArgs ); SfxRequest( const SfxRequest& rOrig ); - virtual ~SfxRequest() override; + ~SfxRequest(); sal_uInt16 GetSlot() const { return nSlot; } void SetSlot(sal_uInt16 nNewSlot) { nSlot = nNewSlot; } diff --git a/sfx2/source/control/request.cxx b/sfx2/source/control/request.cxx index 9279b5dceb5a..5da3517df107 100644 --- a/sfx2/source/control/request.cxx +++ b/sfx2/source/control/request.cxx @@ -133,8 +133,7 @@ SfxRequest::SfxRequest ( const SfxRequest& rOrig ) -: SfxHint( rOrig ), - nSlot(rOrig.nSlot), +: nSlot(rOrig.nSlot), pArgs(rOrig.pArgs? new SfxAllItemSet(*rOrig.pArgs): nullptr), pImpl( new SfxRequest_Impl(this) ) { commit 889848163e8dcb32d58f85ddaf2748517a37b9b9 Author: Caolán McNamara <[email protected]> AuthorDate: Sat Oct 7 15:57:19 2023 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Sun Oct 8 13:17:26 2023 +0200 cid#1547086 Logically dead code since: commit 757a73379dba01fde853443a09583d862c404531 Date: Fri Oct 6 09:31:28 2023 +0100 Related: cool#7373 add an SfxHintId::ThisIsAnSfxEventHint luckily this is the only use of SfxHintId::NONE so easy to audit Change-Id: Id593eb3b2c2d26c9552aa7bf6033afd4f3112120 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157678 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/svx/source/form/fmundo.cxx b/svx/source/form/fmundo.cxx index 80aea1c8a35e..ba693fb02a92 100644 --- a/svx/source/form/fmundo.cxx +++ b/svx/source/form/fmundo.cxx @@ -307,26 +307,26 @@ void FmXUndoEnvironment::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) break; } } - else if (rHint.GetId() != SfxHintId::NONE) + else if (rHint.GetId() == SfxHintId::ThisIsAnSfxEventHint) { - switch (rHint.GetId()) + switch (static_cast<const SfxEventHint&>(rHint).GetEventId()) { - case SfxHintId::Dying: - dispose(); - rModel.SetObjectShell( nullptr ); - break; - case SfxHintId::ModeChanged: + case SfxEventHintId::CreateDoc: + case SfxEventHintId::OpenDoc: ModeChanged(); break; default: break; } } - else if (rHint.GetId() == SfxHintId::ThisIsAnSfxEventHint) + else if (rHint.GetId() != SfxHintId::NONE) { - switch (static_cast<const SfxEventHint&>(rHint).GetEventId()) + switch (rHint.GetId()) { - case SfxEventHintId::CreateDoc: - case SfxEventHintId::OpenDoc: + case SfxHintId::Dying: + dispose(); + rModel.SetObjectShell( nullptr ); + break; + case SfxHintId::ModeChanged: ModeChanged(); break; default: break;
