Bug 143860 - FILESAVE DOCX non-primitive custom shape without handle is exported as rect
Summary: FILESAVE DOCX non-primitive custom shape without handle is exported as rect
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.0.0 alpha0+
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:7.3.0 target:7.2.1
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-08-13 19:55 UTC by Regina Henschel
Modified: 2021-08-17 07:40 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
File to reproduce the problem (24.66 KB, application/vnd.oasis.opendocument.text)
2021-08-13 19:55 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2021-08-13 19:55:26 UTC
Created attachment 174263 [details]
File to reproduce the problem

Open attached file. Both shapes are of type "non-primitive". The curved arrow (left) has no handles, the sinus curve (right) has handles.

Save the file as docx and reopen it. The curved arrow has become a rectangle.

It was OK in Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 2a7e64da7f385de8dbba1802530e251cf29259fb
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (en_US); UI: en-US
Calc: CL

The direct error is in https://opengrok.libreoffice.org/xref/core/oox/source/export/DMLPresetShapeExport.cxx?r=e190196f#218
The shape has no handles and so GetOOXMLPresetGeometry() is called, which returns the preset type "rect" which in turn is written.

But I think, the logic in part after https://opengrok.libreoffice.org/xref/core/oox/source/export/shapes.cxx?r=b33634a5#822 needs a rework in general. The current structure is quite confusing.
Comment 1 Commit Notification 2021-08-15 19:40:43 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/24a8e3209b1d7c2f4f13d5cc3f69726253af9eff

tdf#143860 non-primitive needs custGeom not prstGeom

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 2 Commit Notification 2021-08-17 07:40:03 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/58ba1b975d75225222a27ff404281b9bff133143

tdf#143860 non-primitive needs custGeom not prstGeom

It will be available in 7.2.1.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.