summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2023-10-06 09:31:28 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-10-06 14:11:41 +0200
commit9bd3c25165447fb80b8f8cb8761943294e0a1502 (patch)
tree9b4bf1f36cc0ff39072f0c1b8be17d3bf4dd6ca5 /sd
parent589af9366078036c2f33e3254a628e267628352c (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/+/157620 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/ViewShellBase.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx
index 19be45aaca12..0f9123f5c374 100644
--- a/sd/source/ui/view/ViewShellBase.cxx
+++ b/sd/source/ui/view/ViewShellBase.cxx
@@ -401,10 +401,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() )
@@ -423,8 +424,7 @@ void ViewShellBase::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
}
else
{
- const SfxHintId nSlot = rHint.GetId();
- switch ( nSlot )
+ switch (nHintId)
{
case SfxHintId::LanguageChanged:
{