summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2022-04-21 18:06:57 +0200
committerJulien Nabet <serval2412@yahoo.fr>2022-04-25 18:30:26 +0200
commitfd4410aa5fd079e4277297f1fb70ad8c728e7a17 (patch)
tree739210f297b563c4ce63a93f846641a794f3f03d /xmloff
parente63e769bd30800b72f4a1cdfc7222c0b64f3c770 (diff)
tdf#145240: Can't save drawing if I'm adding a short freeform line with no fill
Here are the steps of the dup tdf#148693: 1. Open a new sheet in LibreOffice Draw 2. Select the tool Shape/Insert/Curves and Polygons 3. Draw a short line (I mean very short) 4. Click "File" > "Save" and select a random place to save => 1 0x00007fcd3c774fcb in o3tl::doAccess<com::sun::star::drawing::PolyPolygonBezierCoords>(com::sun::star::uno::Any const&) (any= uno::Any("[][]com.sun.star.awt.Point": uno::Sequence of length 1 = {uno::Sequence of length 2 = {{X = 0, Y = 0}, {X = 252, Y = 0}}})) at include/o3tl/any.hxx:284 2 0x00007fcd3c74f759 in XMLShapeExport::ImpExportPolygonShape(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const&, XmlShapeType, XMLShapeExportFlags, com::sun::star::awt::Point*) (this=0x8770560, xShape=uno::Reference to (SvxShapePolyPolygon *) 0x7bcb3a8, eShapeType=XmlShapeTypeDrawOpenBezierShape, nFeatures=15, pRefPoint=0x0) at xmloff/source/draw/shapeexport.cxx:2342 3 0x00007fcd3c74d952 in XMLShapeExport::exportShape(com::sun::star::uno::Reference<com::sun::star::drawing::XShape> const&, XMLShapeExportFlags, com::sun::star::awt::Point*, SvXMLAttributeList*) (this=0x8770560, xShape=uno::Reference to (SvxShapePolyPolygon *) 0x7bcb3a8, nFeatures=15, pRefPoint=0x0, pAttrList=0x0) at xmloff/source/draw/shapeexport.cxx:811 4 0x00007fcd3c75cca1 in XMLShapeExport::exportShapes(com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, XMLShapeExportFlags, com::sun::star::awt::Point*) (this=0x8770560, xShapes=uno::Reference to (SdDrawPage *) 0x2d6b258, nFeatures=15, pRefPoint=0x0) at xmloff/source/draw/shapeexport.cxx:1006 Change-Id: Ie6d626999bf606f951f4f79a7c314559a9a886f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133273 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/shapeexport.cxx10
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(