diff options
Diffstat (limited to 'oox/source/export/shapes.cxx')
-rw-r--r-- | oox/source/export/shapes.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 97e1368f4368..c52c6a62b3cb 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -729,8 +729,12 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) OUString sShapeType; ShapeFlag nMirrorFlags = ShapeFlag::NONE; MSO_SPT eShapeType = EscherPropertyContainer::GetCustomShapeType( xShape, nMirrorFlags, sShapeType ); - SdrObjCustomShape* pShape = static_cast<SdrObjCustomShape*>( GetSdrObjectFromXShape( xShape ) ); - bool bIsDefaultObject = EscherPropertyContainer::IsDefaultObject( pShape, eShapeType ); + OSL_ENSURE(nullptr != dynamic_cast< SdrObjCustomShape* >(GetSdrObjectFromXShape(xShape)), "Not a SdrObjCustomShape (!)"); + SdrObjCustomShape& rSdrObjCustomShape(static_cast< SdrObjCustomShape& >(*GetSdrObjectFromXShape(xShape))); + const bool bIsDefaultObject( + EscherPropertyContainer::IsDefaultObject( + rSdrObjCustomShape, + eShapeType)); const char* sPresetShape = msfilter::util::GetOOXMLPresetGeometry( USS( sShapeType ) ); SAL_INFO("oox.shape", "custom shape type: " << sShapeType << " ==> " << sPresetShape); Sequence< PropertyValue > aGeometrySeq; @@ -845,10 +849,10 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) else if( bHasHandles ) bCustGeom = true; - if (bHasHandles && bCustGeom && pShape) + if (bHasHandles && bCustGeom) { WriteShapeTransformation( xShape, XML_a, bFlipH, bFlipV, false, true );// do not flip, polypolygon coordinates are flipped already - tools::PolyPolygon aPolyPolygon( pShape->GetLineGeometry(true) ); + tools::PolyPolygon aPolyPolygon( rSdrObjCustomShape.GetLineGeometry(true) ); sal_Int32 nRotation = 0; // The RotateAngle property's value is independent from any flipping, and that's exactly what we need here. uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY); @@ -864,7 +868,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) else if (bCustGeom) { WriteShapeTransformation( xShape, XML_a, bFlipH, bFlipV ); - bool bSuccess = WriteCustomGeometry( xShape, pShape ); + bool bSuccess = WriteCustomGeometry(xShape, rSdrObjCustomShape); if (!bSuccess) WritePresetShape( sPresetShape ); } |