tdf#119840 elide some dynamic_cast

Change-Id: Iafaedf26231bac142759d2bf667dfba083cf0122
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137503
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2022-07-27 12:44:29 +02:00
parent c7a76952b6
commit 316e4c01f4
4 changed files with 7 additions and 4 deletions

View file

@ -39,6 +39,7 @@ enum class SfxHintId {
LanguageChanged,
RedlineChanged,
DocumentRepair,
SvxViewChanged,
// VCL text hints
TextParaInserted,

View file

@ -1261,7 +1261,7 @@ namespace accessibility
bUpdatedBoundRectAndVisibleChildren = true;
}
}
else if ( dynamic_cast<const SvxViewChangedHint*>( &rHint ) )
else if (rHint.GetId() == SfxHintId::SvxViewChanged)
{
// just check visibility
if (!bUpdatedBoundRectAndVisibleChildren)
@ -1318,8 +1318,9 @@ namespace accessibility
// notification sequence.
maEventQueue.Append( *pSdrHint );
}
else if( const SvxViewChangedHint* pViewHint = dynamic_cast<const SvxViewChangedHint*>( &rHint ) )
else if (rHint.GetId() == SfxHintId::SvxViewChanged)
{
const SvxViewChangedHint* pViewHint = static_cast<const SvxViewChangedHint*>(&rHint);
// process visibility right away, if not within an
// open EE notification frame. Otherwise, event
// processing would be delayed until next EE

View file

@ -99,7 +99,7 @@ OutputDevice* SdrPaintView::GetFirstOutputDevice() const
}
SvxViewChangedHint::SvxViewChangedHint()
SvxViewChangedHint::SvxViewChangedHint() : SfxHint(SfxHintId::SvxViewChanged)
{
}

View file

@ -373,8 +373,9 @@ void SvxTextEditSourceImpl::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
break;
}
}
else if (const SvxViewChangedHint* pViewHint = dynamic_cast<const SvxViewChangedHint*>(&rHint))
else if (rHint.GetId() == SfxHintId::SvxViewChanged)
{
const SvxViewChangedHint* pViewHint = static_cast<const SvxViewChangedHint*>(&rHint);
Broadcast( *pViewHint );
}
}