svx/source/sdr/properties/itemsettools.cxx | 3 ++- svx/source/sdr/properties/properties.cxx | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-)
New commits: commit cf201db990e8973f801ba6c44f74605330a4af74 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Feb 22 14:09:16 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Feb 23 12:50:11 2022 +0100 tdf#64914 elide some dynamic_cast Change-Id: Ifbd41d2de4642f4855f594067ccbbd71464a66d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130345 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/svx/source/sdr/properties/itemsettools.cxx b/svx/source/sdr/properties/itemsettools.cxx index b8be778127f8..3bc0deee38a7 100644 --- a/svx/source/sdr/properties/itemsettools.cxx +++ b/svx/source/sdr/properties/itemsettools.cxx @@ -31,8 +31,9 @@ namespace sdr::properties { ItemChangeBroadcaster::ItemChangeBroadcaster(const SdrObject& rObj) { - if (const SdrObjGroup* pGroupObj = dynamic_cast<const SdrObjGroup*>(&rObj)) + if (rObj.GetObjIdentifier() == SdrObjKind::Group) { + const SdrObjGroup* pGroupObj = static_cast<const SdrObjGroup*>(&rObj); SdrObjListIter aIter(pGroupObj->GetSubList(), SdrIterMode::DeepNoGroups); maRectangles.reserve(aIter.Count()); diff --git a/svx/source/sdr/properties/properties.cxx b/svx/source/sdr/properties/properties.cxx index acfb368bc615..4189edd0c5ac 100644 --- a/svx/source/sdr/properties/properties.cxx +++ b/svx/source/sdr/properties/properties.cxx @@ -111,25 +111,27 @@ namespace sdr::properties const sal_uInt32 nCount(rChange.GetRectangleCount()); // invalidate all new rectangles - if(auto pObjGroup = dynamic_cast<SdrObjGroup*>( &GetSdrObject() )) + SdrObject* pObj = &GetSdrObject(); + if (pObj->GetObjIdentifier() == SdrObjKind::Group) { + SdrObjGroup* pObjGroup = static_cast<SdrObjGroup*>(pObj); SdrObjListIter aIter(pObjGroup, SdrIterMode::DeepNoGroups); while(aIter.IsMore()) { - SdrObject* pObj = aIter.Next(); - pObj->BroadcastObjectChange(); + SdrObject* pChildObj = aIter.Next(); + pChildObj->BroadcastObjectChange(); } } else { - GetSdrObject().BroadcastObjectChange(); + pObj->BroadcastObjectChange(); } // also send the user calls for(sal_uInt32 a(0); a < nCount; a++) { - GetSdrObject().SendUserCall(SdrUserCallType::ChangeAttr, rChange.GetRectangle(a)); + pObj->SendUserCall(SdrUserCallType::ChangeAttr, rChange.GetRectangle(a)); } }