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
Status: RESOLVED NOTABUG
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, 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:


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

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

Hello!

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: 6.1.5.2 (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

Version: 5.2.0.0.alpha0+
Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53
Threads 4; Ver: 4.15; Render: default; 

but not in

Version 4.1.0.0.alpha0+ (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.
https://cgit.freedesktop.org/libreoffice/core/commit/?id=8f8b31abd02876c3601e343b8b3274754f8a61b6
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:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=6c0e752093ddedca0a6f0063567aff19997bab03
"wrong .ui name"
https://cgit.freedesktop.org/libreoffice/core/commit/?id=1a89eaeabd31dddfbad037e8109431a924632543
"if there is no secondary text then keep primary text orig font size"
https://cgit.freedesktop.org/libreoffice/core/commit/?id=786f0eae0673bc18a6e2a71323c70af671e46e66
"Use new widget UI dialogs in line style ctor"
https://cgit.freedesktop.org/libreoffice/core/commit/?id=4dfb33788de68c827cb7a768efe2012cc0ed1ac5
"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.