diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-10-06 09:31:28 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-10-06 12:40:59 +0200 |
commit | 757a73379dba01fde853443a09583d862c404531 (patch) | |
tree | 1438883003eed76e6477c2967dacd7580db16a9d /sd/source | |
parent | cb5285d544a355026a38c69ccf5473956d60e4ee (diff) |
Related: cool#7373 add an SfxHintId::ThisIsAnSfxEventHint
to avoid cost of dynamic_cast of SdrHint to SfxEventHint
Change-Id: Ie0366b7d7ba828d8ffabeed4d65d7c7b275a3ed4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157633
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/view/ViewShellBase.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 6ad6d454be57..9737245f89ff 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -402,10 +402,11 @@ void ViewShellBase::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) { SfxViewShell::Notify(rBC, rHint); - const SfxEventHint* pEventHint = dynamic_cast<const SfxEventHint*>(&rHint); - if (pEventHint) + const SfxHintId nHintId = rHint.GetId(); + + if (nHintId == SfxHintId::ThisIsAnSfxEventHint) { - switch (pEventHint->GetEventId()) + switch (static_cast<const SfxEventHint&>(rHint).GetEventId()) { case SfxEventHintId::OpenDoc: if( GetDocument() && GetDocument()->IsStartWithPresentation() ) @@ -421,8 +422,7 @@ void ViewShellBase::Notify(SfxBroadcaster& rBC, const SfxHint& rHint) } else { - const SfxHintId nSlot = rHint.GetId(); - switch ( nSlot ) + switch (nHintId) { case SfxHintId::LanguageChanged: { |