Created attachment 172547 [details]
Example file from Writer with the freeform curved lines
The attached example file contains Writer freeform curve lines that were found to be exported incorrectly to docx: size of the shape is different in .docx.The freeform line is horizontally squished, while the filled freeform line is vertically squished after export.
Steps to reproduce:
1. Open attached example Writer file. The lines have the correct sizes.
2. Save as .docx, reopen it in Word
In docx, the shapes sizes are different.
Docx shapes should look like the original .odt shapes.
Version: 188.8.131.52.alpha1+ (x64) / LibreOffice Community
Build ID: 91330c503b7eb91d777978018b66890af87cf8f5
CPU threads: 8; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-GB
Created attachment 172548 [details]
The original file saved by Writer to docx
Created attachment 172549 [details]
Screenshot of the original and exported document side by side in Writer and Word
MS Office includes the control points in the size, whereas size in LibreOffice is the bounding box without considering the control points. The problem is not only in Word but in PowerPoint the same.
The error is not in the way Word interprets it, as I first thought. But LibreOffice writes a wrong XML_path element. The w and h value need to be the width and height of the Bezier curve itself, without the control points. That is the API "Size" property. Instead the bounding box of the point array including control points is used. As a result of the wrong rectangle, the coordinates are also wrong. Likely the API FrameRect is needed to shift the PolyPolygonBezier coordinates.
I think, that path-objects need an own method WritePolyPolygon(), which is different from the method needed for CustomShapes.
Proposed patch is in https://gerrit.libreoffice.org/c/core/+/120407
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":
tdf#142605 use frame size in oox export of BezierCurve
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:
Affected users are encouraged to test the fix and report feedback.
Version: 184.108.40.206.alpha0+ (x64) / LibreOffice Community
Build ID: c2de581d1943df2d84f2b71817b6a8bee41f0217
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU