summaryrefslogtreecommitdiff
path: root/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-09-08 13:33:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-08 14:38:15 +0200
commit3afb514362a2ce2701628256fa96d4a5324433d6 (patch)
tree914e6c3b6a37f66543db8515b1031ae65a230b63 /svx/source/customshapes/EnhancedCustomShapeEngine.cxx
parent73c8bd42650dafc38c87b5e6dc1ef222d4f6175c (diff)
simplify static_cast after dynamic_cast
Change-Id: I53ae7f18519fdd878730d1d0316ebc408271c66d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121811 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/customshapes/EnhancedCustomShapeEngine.cxx')
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeEngine.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index 86d2f9bfb00b..6f280f3d7304 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -195,14 +195,11 @@ std::unique_ptr<SdrObject, SdrObjectFreeOp> EnhancedCustomShapeEngine::ImplForce
// get the text bounds and set at text object
tools::Rectangle aTextBounds(rSdrObjCustomShape.GetSnapRect());
- const bool bIsSdrObjCustomShape(nullptr != dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(mxShape)));
+ auto pSdrObjCustomShape = dynamic_cast< SdrObjCustomShape* >(SdrObject::getSdrObjectFromXShape(mxShape));
- if(bIsSdrObjCustomShape)
+ if(pSdrObjCustomShape)
{
- SdrObjCustomShape& rSdrObjCustomShape2(
- static_cast< SdrObjCustomShape& >(
- *SdrObject::getSdrObjectFromXShape(mxShape)));
- EnhancedCustomShape2d aCustomShape2d(rSdrObjCustomShape2);
+ EnhancedCustomShape2d aCustomShape2d(*pSdrObjCustomShape);
aTextBounds = aCustomShape2d.GetTextRect();
}