diff options
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 55de243f07aa..9b069a07eb2c 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2338,11 +2338,13 @@ void XMLShapeExport::ImpExportPolygonShape( { // get PolygonBezier uno::Any aAny( xPropSet->getPropertyValue("Geometry") ); - const basegfx::B2DPolyPolygon aPolyPolygon( - basegfx::utils::UnoPolyPolygonBezierCoordsToB2DPolyPolygon(*o3tl::doAccess<drawing::PolyPolygonBezierCoords>(aAny))); - - if(aPolyPolygon.count()) + auto pSourcePolyPolygon = o3tl::tryAccess<drawing::PolyPolygonBezierCoords>(aAny); + if(pSourcePolyPolygon && pSourcePolyPolygon->Coordinates.getLength()) { + const basegfx::B2DPolyPolygon aPolyPolygon( + basegfx::utils::UnoPolyPolygonBezierCoordsToB2DPolyPolygon( + *pSourcePolyPolygon)); + // complex polygon shape, write as svg:d const OUString aPolygonString( basegfx::utils::exportToSvgD( |