Bug 124059 - FILEOPEN DOCX: Position of text changes when exporting to DOCX and reopen in LO
Summary: FILEOPEN DOCX: Position of text changes when exporting to DOCX and reopen in LO
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: All All
: medium normal
Assignee: Not Assigned
Keywords: bibisected, regression
Depends on:
Blocks: DOCX-Paragraph
  Show dependency treegraph
Reported: 2019-03-13 14:39 UTC by Marco A.G.Pinto
Modified: 2021-03-20 15:36 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:
Regression By:

original ODT (125.73 KB, application/vnd.oasis.opendocument.text)
2019-03-13 14:39 UTC, Marco A.G.Pinto
ODT exported as DOCX (102.01 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-03-13 14:39 UTC, Marco A.G.Pinto

Note You need to log in before you can comment on or make changes to this bug.
Description Marco A.G.Pinto 2019-03-13 14:39:03 UTC
Created attachment 149938 [details]
original ODT


First I tried to open the full ODT with Word 365 but the cover page text was all messed up.

Then, I exported from ODT to DOCX and reopened the DOCX in LO and the text appeared a line or two above the original.
Comment 1 Marco A.G.Pinto 2019-03-13 14:39:38 UTC
Created attachment 149939 [details]
ODT exported as DOCX
Comment 2 Dieter 2019-03-13 20:20:43 UTC
I confirm it with

Version: (x64)
Build ID: 90f8dcf33c87b3705e78202e3df5142b201bd805
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: de-DE (de_DE); Calc: group threaded

I also noticed, that images in odt-file are anchored to paragraph, while images in docx are anchored to character, but I don't now if this has an influence to the position of the text.
Comment 3 m.a.riosv 2019-03-13 23:47:52 UTC
I think it has to do with the wrap mode.
Comment 4 Xisco Faulí 2019-03-14 09:01:27 UTC
Reproduced in

Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53
Threads 4; Ver: 4.15; Render: default; 

but not in

Version (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 5 Aron Budea 2020-05-02 23:14:24 UTC
This could be bibisected using repo bibisect-42max, but the results are puzzling. First, starting from the following commit, the exported DOCX opens in web view, but when switching to print view, the layout is still fine.
author		Luboš Luňák <l.lunak@suse.cz>	2013-08-06 17:02:42 +0200
committer	Luboš Luňák <l.lunak@suse.cz>	2013-08-06 17:17:53 +0200

"compatibility setting for MS Word wrapping text in less space (bnc#822908)"

The wrong layout starts with the following sets of commits (a single commit in the repo), but none of these deal with DOCX import:
"wrong .ui name"
"if there is no secondary text then keep primary text orig font size"
"Use new widget UI dialogs in line style ctor"
"Use new file load error dialog in widget UI"
Comment 6 Justin L 2021-03-20 15:36:53 UTC
The most minor wrapping change (i.e. moving the shopping cart picture one way or the other - or resizing the image) makes a HUGE difference on how the empty paragraphs wrap.

I'd say this example ODT -> DOCX report is valueless since there needs to be SOME emulation in order to move between different implementations of wrapping and image anchoring.

An appropriate design for this particular document would be to set the image as no-wrap - so that it didn't matter whether only one empty paragraph fit in the wrap instead of two.