Bug 143432 - FILESAVE DOCX Frame wrap settings Before and After saved incorrectly
Summary: FILESAVE DOCX Frame wrap settings Before and After saved incorrectly
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.0.3 release
Hardware: All All
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:7.3.0
Keywords: filter:docx, implementationError
Depends on:
Blocks: DOCX-Anchor-and-Text-Wrap
  Show dependency treegraph
 
Reported: 2021-07-19 07:52 UTC by NISZ LibreOffice Team
Modified: 2021-10-06 11:33 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file from Writer (16.32 KB, application/vnd.oasis.opendocument.text)
2021-07-19 07:52 UTC, NISZ LibreOffice Team
Details
The original file saved by Writer (5.70 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-07-19 07:54 UTC, NISZ LibreOffice Team
Details
Screenshot of the original and exported document side by side in Writer (202.62 KB, image/png)
2021-07-19 07:54 UTC, NISZ LibreOffice Team
Details
Screenshot of the original and exported document side by side in Word and Writer (244.46 KB, image/png)
2021-07-19 08:04 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-07-19 07:52:19 UTC
Created attachment 173662 [details]
Example file from Writer

This is split off from bug #135940
Attached example file demonstrates a frame with several different wrap settings: Before, After, Parallel and Optimal.
When saved as DOCX, the Before and After become incorrect, changing the document layout.

Steps to reproduce:
    1. Open attached file
    2. Save as DOCX
    3. Reopen in Word, compare to original.

Actual results:
The first frame with After wrap becomes Square wrapped with “Wrap text” set to “Largest only”.
The second frame with Before wrap also becomes Square wrapped with “Wrap text” set to “Largest only”.
The third and fourth frames with Parallel and Optimal wrap are exported fine.

Expected results:
The first shape should become Square wrapped with “Wrap text” set to “Only right”.
The second shape should become Square wrapped with “Wrap text” set to “Only left”.

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

Also in 7.0, 6.0, 5.0, 4.3 (but they remained frames!)
In 4.2, the wrap settings were exported correctly but for frames.
Comment 1 NISZ LibreOffice Team 2021-07-19 07:54:02 UTC
Created attachment 173663 [details]
The original file saved by Writer
Comment 2 NISZ LibreOffice Team 2021-07-19 07:54:27 UTC
Created attachment 173664 [details]
Screenshot of the original and exported document side by side in Writer
Comment 3 NISZ LibreOffice Team 2021-07-19 08:04:28 UTC
Created attachment 173665 [details]
Screenshot of the original and exported document side by side in Word and Writer
Comment 4 Timur 2021-07-19 09:14:56 UTC
Repro 7.3+. Interesting that ODT attachment 167020 [details] with 6 wraps from bug 136059 didn't show this.
Comment 5 Regina Henschel 2021-07-19 13:14:45 UTC
I'll work on it and fix it together with the other wrap problems in DocxSdrExport::startDMLAnchorInline.
Comment 6 NISZ LibreOffice Team 2021-07-20 12:39:30 UTC
(In reply to Timur from comment #4)
> Repro 7.3+. Interesting that ODT attachment 167020 [details] with 6 wraps
> from bug 136059 didn't show this.

Here the starting object is a frame created in Writer.
Docx exports that as a DML drawing shape, not as frame. Only Word-made frames are exported back as frames.

In bug 136059 we started with drawing shapes created in Writer which are exported as DML drawing shapes.

So basically anything changed in the drawing object export can have two VERY different source objects in Writer, and usually only one of them is present in any example document.
Comment 7 Commit Notification 2021-08-13 14:01:36 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/61ef73bb9e06ac7325abc26698314d7e35c164cc

tdf#143432 and more, improve wrap contour export

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 8 Regina Henschel 2021-08-13 18:25:40 UTC
Many thanks to Miklos, who reviewed my patch.
Comment 9 NISZ LibreOffice Team 2021-10-06 11:33:36 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