Bug 143406 - FILESAVE DOCX Grouped shapes Contour wrap is not saved
Summary: FILESAVE DOCX Grouped shapes Contour wrap is not saved
Status: NEW
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: DOCX-Grouped-Shapes Shape-ODF-OOXML-export
  Show dependency treegraph
 
Reported: 2021-07-16 10:50 UTC by NISZ LibreOffice Team
Modified: 2022-05-02 11:40 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
attachment 168914 saved with current nightly (919.34 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-07-16 10:50 UTC, NISZ LibreOffice Team
Details
The example file and its docx version in current master (311.11 KB, image/png)
2021-09-16 10:33 UTC, NISZ LibreOffice Team
Details
The exported docx in Writer and Word (418.88 KB, image/png)
2021-09-16 10:37 UTC, NISZ LibreOffice Team
Details
The example file saved by Writer (919.41 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-09-16 10:42 UTC, NISZ LibreOffice Team
Details
The previous example fixed up in Word 2019 (2.18 MB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-09-16 10:44 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-16 10:50:14 UTC
Created attachment 173629 [details]
attachment 168914 [details] saved with current nightly

This is split off from bug 139650
attachment 168914 [details] contains a grouped shape with Contour wrap set.
When saved as DOCX the wrap is Square instead of Tight.

Steps to reproduce:
    1. Open attachment 168914 [details]
    2. Save as DOCX, reload in Word

Actual results:
Bottom grouped shape no longer has contour wrap.
See attachment 173625 [details] 

Expected results:
Should save the contour wrap.

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. 
In 4.0 the shape completely disappeared.
Comment 1 Regina Henschel 2021-07-16 12:22:03 UTC
That is a missing feature. Only for custom shapes a wrap polygon is created and that one is bad. The relevant part is in docxsdrexport.cxx, starting in line 1092. In addition interpretation of text::WrapTextMode_LEFT and text::WrapTextMode:Right is missing. I have already started to work on it, so I would like to take it. But I'm not working full time on LibreOffice, so I need some time. Do you need a quick solution?
Comment 2 Regina Henschel 2021-07-19 13:08:47 UTC
I'll work on it and fix it together with the other wrap problems in DocxSdrExport::startDMLAnchorInline.
Comment 3 NISZ LibreOffice Team 2021-09-16 10:33:31 UTC
Created attachment 175062 [details]
The example file and its docx version in current master

The contour wrap seems to be exported correctly now 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

after:
commit 61ef73bb9e06ac7325abc26698314d7e35c164cc	[log]
author	Regina Henschel <rb.henschel@t-online.de>	Sun Aug 08 01:05:09 2021 +0200
committer	Miklos Vajna <vmiklos@collabora.com>	Fri Aug 13 16:00:35 2021 +0200

tdf#143432 and more, improve wrap contour export
Comment 4 NISZ LibreOffice Team 2021-09-16 10:37:11 UTC
Created attachment 175063 [details]
The exported docx in Writer and Word

However it is still not good in Word:
- Writer sees the grouped shape as Optimal wrap with Contour enabled
- Word sees it as Through wrap instead of Tight
Comment 5 NISZ LibreOffice Team 2021-09-16 10:42:03 UTC
Created attachment 175064 [details]
The example file saved by Writer

The relevant part seems to be this in document.xml:

								<wp:wrapThrough wrapText="largest">
									<wp:wrapPolygon edited="0">
										<wp:start x="0"
        											y="0"/>
										<wp:lineTo x="21600"
         											y="0"/>
										<wp:lineTo x="21600"
         											y="21600"/>
										<wp:lineTo x="0"
         											y="21600"/>
										<wp:lineTo x="0"
         											y="0"/>
									</wp:wrapPolygon>
								</wp:wrapThrough>
Comment 6 NISZ LibreOffice Team 2021-09-16 10:44:42 UTC
Created attachment 175065 [details]
The previous example fixed up in Word 2019

After manually fixing it in Word and saving, the relevant looking part in document.xml:

								<wp:wrapTight wrapText="largest">
									<wp:wrapPolygon edited="0">
										<wp:start x="10740"
        											y="0"/>
										<wp:lineTo x="10740"
         											y="7144"/>
										<wp:lineTo x="0"
         											y="8288"/>
										<wp:lineTo x="0"
         											y="14432"/>
										<wp:lineTo x="10502"
         											y="16289"/>
										<wp:lineTo x="10502"
         											y="21433"/>
										<wp:lineTo x="19571"
         											y="21433"/>
										<wp:lineTo x="19571"
         											y="4858"/>
										<wp:lineTo x="21003"
         											y="1143"/>
										<wp:lineTo x="20765"
         											y="0"/>
										<wp:lineTo x="10740"
         											y="0"/>
									</wp:wrapPolygon>
								</wp:wrapTight>
Comment 7 Xisco Faulí 2022-05-02 11:40:55 UTC
Dear Regina,
bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assign it back to yourself if you're still working on this.