Bug 142605 - FILESAVE DOCX Writer curved lines resize incorrectly
Summary: FILESAVE DOCX Writer curved lines resize incorrectly
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:7.3.0
Keywords:
Depends on:
Blocks: Shape-ODF-OOXML-export
  Show dependency treegraph
 
Reported: 2021-06-01 12:48 UTC by NISZ LibreOffice Team
Modified: 2021-10-06 11:48 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Writer with the freeform curved lines (9.03 KB, application/vnd.oasis.opendocument.text)
2021-06-01 12:48 UTC, NISZ LibreOffice Team
Details
The original file saved by Writer to docx (5.20 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-06-01 12:48 UTC, NISZ LibreOffice Team
Details
Screenshot of the original and exported document side by side in Writer and Word (119.00 KB, image/png)
2021-06-01 12:48 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2021-06-01 12:48:01 UTC
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

Actual results:
In docx, the shapes sizes are different.

Expected results:
Docx shapes should look like the original .odt shapes.

LibreOffice details:
Version: 7.2.0.0.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
Calc: threaded
Comment 1 NISZ LibreOffice Team 2021-06-01 12:48:22 UTC
Created attachment 172548 [details]
The original file saved by Writer to docx
Comment 2 NISZ LibreOffice Team 2021-06-01 12:48:44 UTC
Created attachment 172549 [details]
Screenshot of the original and exported document side by side in Writer and Word
Comment 3 Regina Henschel 2021-06-18 00:11:28 UTC
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.
Comment 4 Regina Henschel 2021-08-10 20:50:28 UTC
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.
Comment 5 Regina Henschel 2021-08-12 17:27:39 UTC
Proposed patch is in https://gerrit.libreoffice.org/c/core/+/120407
Comment 6 Commit Notification 2021-08-14 15:16:34 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/925fa608d65a5970f966d45e33cccf04e2318060

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:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 NISZ LibreOffice Team 2021-10-06 11:48:08 UTC
Verified in: 

Version: 7.3.0.0.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
Calc: threaded