Bug 112095 - LibreOffice Draw grouped shape object is scrambled when .odt is saved as a .docx
Summary: LibreOffice Draw grouped shape object is scrambled when .odt is saved as a .docx
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.0.0.5 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:docx
Depends on:
Blocks: Shape-ODF-OOXML-export
  Show dependency treegraph
 
Reported: 2017-08-29 22:58 UTC by Bob Furber
Modified: 2021-08-09 07:25 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
An imported Draw object is scrambled when document is saved as a docx file (46.62 KB, application/zip)
2017-08-29 22:58 UTC, Bob Furber
Details
The original file and its docx version in LO7.1 alpha (199.37 KB, image/png)
2020-10-15 10:28 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bob Furber 2017-08-29 22:58:04 UTC
Created attachment 135857 [details]
An imported Draw object is scrambled when document is saved as a docx file

This may be the same as 80206.

To reproduce:

1. Copy an object from an odg file

2. Insert the object in a docx or odg file

3. Save the file as a docx file and close

4. Open the docx file to find the graphic object is scrambled


Note: If the file is saved as an odt file, the graphics are NOT scrambled on saving
Comment 1 Timur 2017-08-30 17:46:10 UTC
Repro with 5.0.6 and 6.0+ in Windows. Previous versions worse, no regression. 
Easier is just: open attached .odt, save as .docx, close and reopen
It's fonts that are wrong, thay can't fit.
Comment 2 Bob Furber 2017-08-31 04:02:14 UTC
(In reply to Timur from comment #1)
> Repro with 5.0.6 and 6.0+ in Windows. Previous versions worse, no
> regression. 
> Easier is just: open attached .odt, save as .docx, close and reopen
> It's fonts that are wrong, thay can't fit.

It is worse than fonts can't fit. 

The attached files show that features such as lines and text are dislocated or lost.
Comment 3 QA Administrators 2018-09-01 02:41:51 UTC Comment hidden (obsolete)
Comment 4 QA Administrators 2020-09-14 03:48:14 UTC Comment hidden (obsolete)
Comment 5 Timur 2020-09-14 08:01:31 UTC Comment hidden (obsolete)
Comment 6 Gabor Kelemen (allotropia) 2020-10-15 10:27:24 UTC
This is a grouped shape being exported to DML incorrectly. Changing meta bug.

At first two problems are obvious:
- Text boxes have the Format - Text box and Shape - Text ; Word wrap text in shape option OFF in odt but ON in exported and reopened docx. Turning it back OFF makes the text fit in the boxes. Similar to bug #136881
- Arrow sizes and positions are changed in exported and reopened docx. This looks quite like bug #118693
Comment 7 Gabor Kelemen (allotropia) 2020-10-15 10:28:43 UTC
Created attachment 166380 [details]
The original file and its docx version in LO7.1 alpha

Version: 7.1.0.0.alpha0+
Build ID: f21f3d094cfb495c89dfb0a23ecb061ef1a2178e
CPU threads: 8; OS: Linux 5.0; UI render: default; VCL: gtk3
Locale: hu-HU (hu_HU.UTF-8); UI: en-US
Calc: threaded
Comment 8 Regina Henschel 2021-08-08 19:54:56 UTC Comment hidden (obsolete)
Comment 9 NISZ LibreOffice Team 2021-08-09 07:04:15 UTC
(In reply to Regina Henschel from comment #8)
> The arrows look good in LO 7.3.
> 
> The texts do not look good. In LibreOffice TextWordWrap is OFF, and in Word
> it is ON. Different defaults?

This looks like the bug 136881 but for wpg. The Word Wrap option is not exported with the OFF state, it's enabled after docx export both in Word and Writer.

On the other hand: turning it off in Word for one shape and saving that opens correctly in Writer.
Comment 10 NISZ LibreOffice Team 2021-08-09 07:25:06 UTC
(In reply to NISZ LibreOffice Team from comment #9)
> On the other hand: turning it off in Word for one shape and saving that
> opens correctly in Writer.

This is how it works from Word:

												<wps:bodyPr wrap="none"
          													lIns="90000"
          													tIns="45000"
          													rIns="90000"
          													bIns="45000"
          													anchor="ctr">
													<a:noAutofit/>
												</wps:bodyPr>

Writer does not save the wrap="none" attribute. Manually adding it to the XML fixes it.