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.
Created attachment 173663 [details] The original file saved by Writer
Created attachment 173664 [details] Screenshot of the original and exported document side by side in Writer
Created attachment 173665 [details] Screenshot of the original and exported document side by side in Word and Writer
Repro 7.3+. Interesting that ODT attachment 167020 [details] with 6 wraps from bug 136059 didn't show this.
I'll work on it and fix it together with the other wrap problems in DocxSdrExport::startDMLAnchorInline.
(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.
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.
Many thanks to Miklos, who reviewed my patch.
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