Bug 142606 - FILESAVE DOCX Writer freeform line placement incorrect
Summary: FILESAVE DOCX Writer freeform line placement incorrect
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: Not Assigned
URL:
Whiteboard:
Keywords: filter:docx
Depends on:
Blocks: Shape-ODF-OOXML-export
  Show dependency treegraph
 
Reported: 2021-06-01 12:55 UTC by NISZ LibreOffice Team
Modified: 2021-09-27 15:55 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Writer with the freeform line (9.34 KB, application/vnd.oasis.opendocument.text)
2021-06-01 12:55 UTC, NISZ LibreOffice Team
Details
The original file saved by Writer to docx (6.19 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-06-01 12:56 UTC, NISZ LibreOffice Team
Details
Screenshot of the original and exported document side by side in Writer and Word (70.87 KB, image/png)
2021-06-01 12:56 UTC, NISZ LibreOffice Team
Details
The example file in current Writer master (70.09 KB, image/png)
2021-09-16 11:11 UTC, NISZ LibreOffice Team
Details
Screenshot of the original and exported document side by side in Writer and Word (83.16 KB, image/png)
2021-09-16 11:22 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:55:57 UTC
Created attachment 172550 [details]
Example file from Writer with the freeform line

The attached example file contains a Writer freeform line shape that were found to be exported incorrectly to docx: the exported shape’s placement is different in .docx.

Steps to reproduce:
1.	Open attached example Writer file.
2.	Save as .docx, reopen files

Actual results:
In docx, the shape’s vertical placement changed (downwards) and its horizontal placement also changed towards the left.

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

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:56:21 UTC
Created attachment 172551 [details]
The original file saved by Writer to docx
Comment 2 NISZ LibreOffice Team 2021-06-01 12:56:40 UTC
Created attachment 172552 [details]
Screenshot of the original and exported document side by side in Writer and Word
Comment 3 Dieter 2021-06-18 06:12:36 UTC
Please check the attachments. Either attachment 172551 [details] (one shape) is wrong or attachment 172552 [details] (two shapes).

=> NEEDINFO
Comment 4 Regina Henschel 2021-06-18 11:15:29 UTC
The error is, that the position is rotated in lclMovePositionWithRotation() in sw/source/filter/ww8/docxsdrexport.cxx. Some objects report a rotation angle, but are not actually rotated, because rotation is incorporated in its members or points. They need to be excluded from position rotation.

It would be fixed with https://gerrit.libreoffice.org/c/core/+/115668. I had already identified OBJ_GRUP and OBJ_LINE. I have now added OBJ_PATHLINE and OBJ_PATHFILL.

I'm still waiting for review of that patch :(
Comment 5 Regina Henschel 2021-07-09 13:18:50 UTC
I think, it is fixed now with commit 3262fc5ef3bde5b158909d11ccb008161ea95519. Please try with current master.
Comment 6 NISZ LibreOffice Team 2021-09-16 11:11:21 UTC
Created attachment 175067 [details]
The example file in current Writer master

Looks good after docx export in:

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 80a47aae1419842f4496f02028e2b49763aea25b
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: default; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL

indeed after

https://cgit.freedesktop.org/libreoffice/core/commit/?id=3262fc5ef3bde5b158909d11ccb008161ea95519

author	Regina Henschel <rb.henschel@t-online.de>	2021-05-15 23:40:34 +0200
committer	Miklos Vajna <vmiklos@collabora.com>	2021-06-28 09:49:00 +0200
commit 3262fc5ef3bde5b158909d11ccb008161ea95519 (patch)

tdf#142304 a.o. Improve wrap margins in docx filters
Comment 7 NISZ LibreOffice Team 2021-09-16 11:22:15 UTC
Created attachment 175068 [details]
Screenshot of the original and exported document side by side in Writer and Word

For the record: Correct screenshot of the old bad state. See also bug 142605 and the attachments there; those also export correctly now.
Comment 8 NISZ LibreOffice Team 2021-09-16 11:22:59 UTC
All in all, thanks for fixing this Regina!
Comment 9 Dieter 2021-09-27 15:55:37 UTC
VERIFIED with

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 7cd5b35caa8d4fa9d0ba2b2c6ce4b88726ed2be6
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL