Bug 148710 - Layout of an image in docx file is different from the layout in odt file, even when the anchorings used are docx-compatible ones (i.e., "as char" and "to char" anchorings)
Summary: Layout of an image in docx file is different from the layout in odt file, eve...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: WPSShapeTextImport-Change
  Show dependency treegraph
 
Reported: 2022-04-21 14:10 UTC by Jambunathan K
Modified: 2022-05-24 15:51 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
frames.odt: This file uses only "as-char" and "to char" anchorings (30.21 KB, application/vnd.oasis.opendocument.text)
2022-04-21 14:11 UTC, Jambunathan K
Details
frames.docx: This is what you get when you save `frames.odt` to `docx` format (20.66 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-04-21 14:12 UTC, Jambunathan K
Details
to-char-anchoring: difference-in-layout-between-odt-and-docx.png: Note the difference in layout between ODT and DOCX version (204.08 KB, image/png)
2022-04-21 14:17 UTC, Jambunathan K
Details
Outer Frame Config.png: This frame limits the paragraph width to 7.1cm or so (158.02 KB, image/png)
2022-04-21 14:18 UTC, Jambunathan K
Details
Config of Frame Containing Text "(1)".png: This frame is positioned to the "right" of "paragraph text area" (162.17 KB, image/png)
2022-04-21 14:23 UTC, Jambunathan K
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jambunathan K 2022-04-21 14:10:42 UTC
Description:
Layout of an image in docx file is different from the layout in odt file. This is even when the anchoring used are docx-compatible.  In other words, the ODT file uses ony "as character" and "to character" anchorings which are translatable to docx (and deliberately avoids the "to paragraph" anchoring which is NOT translateable to docx format)

Steps to Reproduce:
1. `frames.odt`: This file uses anchoring which are "docx" compatible i.e., it uses only "as character" and "to character" anchoring.
2. `frames.docx`:  This is the docx version of `frames.odt`


Actual Results:
The `frames.odt` and `frames.docx` should be laid out the same way.

Expected Results:
The `frames.odt` and `frames.docx` are laid out differently.  See the attached annotation in attached screenshot for details.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.3.2.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 4; OS: Linux 5.16; UI render: default; VCL: x11
Locale: en-IN (en_IN); UI: en-US
Debian package version: 1:7.3.1-1
Calc: threaded


$ dpkg -l | grep writer
ii  libreoffice-writer                                 1:7.3.1-1                          amd64        office productivity suite -- word processor
Comment 1 Jambunathan K 2022-04-21 14:11:48 UTC
Created attachment 179709 [details]
frames.odt:  This file uses only "as-char" and "to char" anchorings
Comment 2 Jambunathan K 2022-04-21 14:12:43 UTC
Created attachment 179710 [details]
frames.docx:  This is what you get when you save `frames.odt` to `docx` format
Comment 3 Jambunathan K 2022-04-21 14:17:26 UTC
Created attachment 179711 [details]
to-char-anchoring: difference-in-layout-between-odt-and-docx.png:  Note the difference in layout between ODT and DOCX version

to-char-anchoring: difference-in-layout-between-odt-and-docx.png:  Note the difference in layout between ODT and DOCX version.  

The ODT and DOCX files are shown side-by-side using a tiling window manager `EXWM` in this case. 

See image annotations for more details.
Comment 4 Jambunathan K 2022-04-21 14:18:39 UTC
Created attachment 179712 [details]
Outer Frame Config.png:  This frame limits the paragraph width to 7.1cm or so
Comment 5 Jambunathan K 2022-04-21 14:23:55 UTC
Created attachment 179713 [details]
Config of Frame Containing Text "(1)".png:  This frame is positioned to the "right" of "paragraph text area"

Config of Frame Containing Text "(1)".png:  This frame is positioned to the "right" of "paragraph text area".

This frame gets pushed to the extreme right in the DOCX file.  Note the position of this frame in ODT and DOCX files.
Comment 6 Jambunathan K 2022-04-21 14:29:59 UTC
Link for submitter's eyes only: https://github.com/kjambunathan/org-mode-ox-odt/issues/177
Comment 7 Jambunathan K 2022-04-23 02:12:19 UTC Comment hidden (obsolete)
Comment 8 Timur 2022-05-04 14:52:02 UTC
Repro 7.4+. 
It is a result of 2 commits, in 4.3 and in 4.4. Now, I can bibisect 4.4.

In 4.4: 
commit 64c8b13f248fe7ea3808c7f8e62d0d656f170378
    commit d379d18666aa42031359ca8eb34b0021960347ae  (known commit with Meta bug) 
    pre source-hash-8e67a7796f598de2f11b694542bccb48343f0d9a
    Author:     Miklos Vajna <vmiklos@collabora.co.uk>
    oox: import WPS shape with text as shape with textbox