sw/source/filter/ww8/docxsdrexport.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
New commits: commit 9f84cd2766e66bf3bd7878e50a6732f8fca63ed7 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun Aug 15 19:44:18 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun Aug 15 22:35:24 2021 +0200 crashtesting: failure on export tdf87915-2.odt to docx in this example ConvertToPolyObj returned a SdrObjGroup* so cast to SdrPathObj* goes wrong. new since commit 61ef73bb9e06ac7325abc26698314d7e35c164cc Date: Sun Aug 8 01:05:09 2021 +0200 tdf#143432 and more, improve wrap contour export Change-Id: I80312971fbe7e5b6e17e7ae41f2afbbb05f21d76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120515 Tested-by: Jenkins Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index d4e616d1ff65..8d4a7c54e86b 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -389,11 +389,12 @@ tools::Polygon lcl_CreateContourPolygon(SdrObject* pSdrObj) // case OBJ_PLIN: disabled for unknown reason; related bug 75254. { // Includes removing any control points - SdrObject* pConverted = pSdrObj->ConvertToPolyObj(false, false).release(); + SdrObjectUniquePtr pNewObj = pSdrObj->ConvertToPolyObj(false, false); + SdrPathObj* pConverted = dynamic_cast<SdrPathObj*>(pNewObj.get()); if (!pConverted) break; - aPolyPolygon = static_cast<SdrPathObj*>(pConverted)->GetPathPoly(); - SdrObject::Free(pConverted); + aPolyPolygon = pConverted->GetPathPoly(); + pNewObj.reset(); // Word adds a line from last to first point. That will cut of indentations from being // filled. To prevent this, the wrap polygon is lead along the path back to the first