Bug 112313 - FILESAVE ODT->DOCX: Text below image moves up next to it (optimal wrap) when file saved as DOCX (ODT 2cm wrap, DOCX ~1cm wrap; comment 14)
Summary: FILESAVE ODT->DOCX: Text below image moves up next to it (optimal wrap) when ...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.2.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, filter:docx, regression
: 61494 135155 139260 142381 144197 (view as bug list)
Depends on:
Blocks: DOCX DOCX-Anchor-and-Text-Wrap
  Show dependency treegraph
 
Reported: 2017-09-10 23:04 UTC by Aron Budea
Modified: 2023-06-09 11:58 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample ODT, save as DOCX (10.04 KB, application/vnd.oasis.opendocument.text)
2017-09-10 23:04 UTC, Aron Budea
Details
text-image_8f8b31abd02876c3601e343b8b3274754f8a61b6.pdf: what completely broken means (7.01 KB, application/pdf)
2017-11-06 15:25 UTC, Justin L
Details
text-image_word2003.pdf: how it looks in MS Office 2003 (2.82 KB, application/pdf)
2017-11-06 17:37 UTC, Justin L
Details
Original ODT saved as PDF from MSO 2013 (15.67 KB, application/pdf)
2017-11-11 13:11 UTC, Buovjaga
Details
DOCX from LibreOffice saved as PDF from MSO2013 (15.66 KB, application/pdf)
2017-11-11 13:12 UTC, Buovjaga
Details
The example file after manually changing the wrapping to None (10.38 KB, application/vnd.oasis.opendocument.text)
2020-12-16 15:25 UTC, NISZ LibreOffice Team
Details
The changed example file saved to DOCX with current Writer (6.13 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-12-16 15:25 UTC, NISZ LibreOffice Team
Details
The modified docx side by side in Word and Writer (170.65 KB, image/png)
2020-12-16 15:28 UTC, NISZ LibreOffice Team
Details
The example file and its docx version in Writer showing their 2/1 cm limits (45.19 KB, image/png)
2021-07-13 16:07 UTC, NISZ LibreOffice Team
Details
Example from Word showing that it does measure text length before wrapping (14.91 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-07-13 16:09 UTC, NISZ LibreOffice Team
Details
The Word example file (31.83 KB, image/png)
2021-07-13 16:14 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2017-09-10 23:04:03 UTC
Created attachment 136159 [details]
Sample ODT, save as DOCX

Open the attached ODT, containing an inserted image, and text above and below.
Save it as DOCX.
Reopen the DOCX.

=> The bottom text is repositioned next to the image.

Observed using LO 5.4.1.2 & 4.2.0.4 / Windows 7.
Not reproduced using LO 4.1.0.4.
=> regression
Comment 2 Buovjaga 2017-09-11 06:55:31 UTC
Repro.

Arch Linux 64-bit, KDE Plasma 5
Version: 6.0.0.0.alpha0+
Build ID: 09122a537318f7ada075820f3b1ef83a64e56751
CPU threads: 8; OS: Linux 4.12; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on September 10th 2017
Comment 3 Justin L 2017-11-06 15:25:21 UTC
Created attachment 137576 [details]
text-image_8f8b31abd02876c3601e343b8b3274754f8a61b6.pdf: what completely broken means

First broken completely in 4.2 by commit 8f8b31abd02876c3601e343b8b3274754f8a61b6 Author: Luboš Luňák  CommitDate: Tue Aug 6 17:17:53 2013 +0200
  compatibility setting for MS Word wrapping text in less space (bnc#822908)
Comment 4 Justin L 2017-11-06 17:37:23 UTC
Created attachment 137579 [details]
text-image_word2003.pdf: how it looks in MS Office 2003

I'd probably flag this as notabug. The document is DESIGNED to have the text flow optimally, which implies that if there is room, the text should go beside. Microsoft Office wraps the text around too - thus it makes sense that LO should do the same. If there is any bug here, it is the difference in how the wrapping is taking place. This should be checked with Word 2013 as well, for recent confirmation (and also see how Word handles the original .odt).
Comment 5 Buovjaga 2017-11-11 13:11:58 UTC
Created attachment 137680 [details]
Original ODT saved as PDF from MSO 2013
Comment 6 Buovjaga 2017-11-11 13:12:49 UTC
Created attachment 137681 [details]
DOCX from LibreOffice saved as PDF from MSO2013
Comment 7 Kevin Suo 2017-12-21 04:01:25 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2019-10-11 02:37:58 UTC Comment hidden (obsolete, spam)
Comment 9 NISZ LibreOffice Team 2020-12-16 15:24:18 UTC
This image is horizontally positioned as "Center" to "Paragraph area" and with optimal wrap.
This is similar to the example file in bug #124059 - the image of the shopping cart has the same settings.

Now to reproduce the original layout in docx you need to set it as No wrap (Writer) / Below&above (in Word). 

Setting "No Wrap" does not change the layout in Writer, but retains it after saving to docx when it is then reopened in Word (tested with my 2013) and Writer.
Comment 10 NISZ LibreOffice Team 2020-12-16 15:25:19 UTC
Created attachment 168231 [details]
The example file after manually changing the wrapping to None
Comment 11 NISZ LibreOffice Team 2020-12-16 15:25:59 UTC
Created attachment 168232 [details]
The changed example file saved to DOCX with current Writer

Version: 7.2.0.0.alpha0+ (x64)
Build ID: 59301a1cadd87a63276650975252d14e8477e632
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL
Comment 12 NISZ LibreOffice Team 2020-12-16 15:28:52 UTC
Created attachment 168233 [details]
The modified docx side by side in Word and Writer
Comment 13 NISZ LibreOffice Team 2020-12-17 09:02:15 UTC
Just checked the images in bug #117611 - those are also centered to paragraph, with optimal wrap. 
Setting no wrap in docx restores the intended layout for those too.

There is however a bit more spacing between the image and the text in that mode, as seen on the previous attachment #168233 [details] . 
That causes some layout difference with the example in bug #124059, making paragraphs at the bottom of the first page wrap to the next page.
Comment 14 NISZ LibreOffice Team 2021-07-13 16:04:04 UTC
Playing a bit with resizing the image horizontally, it seems that in odt there is no wrap if the horizontal space between the image and the page margin is less than 2 cm, but in docx this magic value is 1 cm.

Word on the other hand measures whether the space between the image and the page margin is enough to fit the actual text - so in the same space the wrap will happen (or not) differently for text like "x x x x x x x x" and "xxxx xxxx" and "xxxxxxxx xxxxxxxx".

It's way worse than just switching up wrap options on export :(.
Comment 15 NISZ LibreOffice Team 2021-07-13 16:07:49 UTC
Created attachment 173534 [details]
The example file and its docx version in Writer showing their 2/1 cm limits

odt does not wrap below 2 cm spacing, docx does not wrap below 1 cm - but it does between 1 and 2.
Comment 16 NISZ LibreOffice Team 2021-07-13 16:09:13 UTC
Created attachment 173535 [details]
Example from Word showing that it does measure text length before wrapping
Comment 17 NISZ LibreOffice Team 2021-07-13 16:14:46 UTC
Created attachment 173536 [details]
The Word example file

For the first image there is about 1 cm on the left, but xxxxx does not fit, so no wrap.
For the second image there is the same 1 cm on the left but words around it are shorter "xx" so they fit and wrap the image.
For the third image there is 2 cm space to the margin but the words around it are even longer than that so there is no wrap.
Comment 18 NISZ LibreOffice Team 2021-08-31 09:09:45 UTC
*** Bug 144197 has been marked as a duplicate of this bug. ***
Comment 19 Justin L 2023-03-15 14:44:37 UTC
*** Bug 135155 has been marked as a duplicate of this bug. ***
Comment 20 Justin L 2023-03-15 15:04:19 UTC
*** Bug 139260 has been marked as a duplicate of this bug. ***
Comment 21 Justin L 2023-03-28 12:28:51 UTC
*** Bug 142381 has been marked as a duplicate of this bug. ***
Comment 22 Justin L 2023-05-27 13:44:41 UTC
*** Bug 61494 has been marked as a duplicate of this bug. ***