summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-02-22 14:09:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-02-23 12:50:11 +0100
commitcf201db990e8973f801ba6c44f74605330a4af74 (patch)
tree716d470981b6f06fe6160145a2763ed44a3241f9 /svx
parentee351bc9d83798c4bed6ef891e602981ae88ae24 (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sdr/properties/itemsettools.cxx3
-rw-r--r--svx/source/sdr/properties/properties.cxx12
2 files changed, 9 insertions, 6 deletions
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));
}
}