include/svl/hint.hxx | 1 + svx/source/accessibility/AccessibleTextHelper.cxx | 5 +++-- svx/source/svdraw/svdpntv.cxx | 2 +- svx/source/unodraw/unoshtxt.cxx | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-)
New commits: commit 316e4c01f4056242b82047808169c78692a3d9e3 Author: Noel Grandin <[email protected]> AuthorDate: Wed Jul 27 12:44:29 2022 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Wed Jul 27 18:27:17 2022 +0200 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 <[email protected]> diff --git a/include/svl/hint.hxx b/include/svl/hint.hxx index f46df6a34342..f7be42e8160d 100644 --- a/include/svl/hint.hxx +++ b/include/svl/hint.hxx @@ -39,6 +39,7 @@ enum class SfxHintId { LanguageChanged, RedlineChanged, DocumentRepair, + SvxViewChanged, // VCL text hints TextParaInserted, diff --git a/svx/source/accessibility/AccessibleTextHelper.cxx b/svx/source/accessibility/AccessibleTextHelper.cxx index b18c33510211..7a55ac50f343 100644 --- a/svx/source/accessibility/AccessibleTextHelper.cxx +++ b/svx/source/accessibility/AccessibleTextHelper.cxx @@ -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 diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index f403ddd578ac..76077516e896 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -99,7 +99,7 @@ OutputDevice* SdrPaintView::GetFirstOutputDevice() const } -SvxViewChangedHint::SvxViewChangedHint() +SvxViewChangedHint::SvxViewChangedHint() : SfxHint(SfxHintId::SvxViewChanged) { } diff --git a/svx/source/unodraw/unoshtxt.cxx b/svx/source/unodraw/unoshtxt.cxx index 71e63997e4f1..9dc311f9c438 100644 --- a/svx/source/unodraw/unoshtxt.cxx +++ b/svx/source/unodraw/unoshtxt.cxx @@ -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 ); } }
