Bug 139105

Summary: One image out of line after DOCX/DOC export
Product: LibreOffice Reporter: Telesto <telesto>
Component: WriterAssignee: Attila Bakos (NISZ) <bakos.attilakaroly>
Status: RESOLVED DUPLICATE    
Severity: normal CC: kelemeng
Priority: medium    
Version: 3.5.0 release   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 120466    
Attachments: Example file
The example file and its docx version in current master
Modified example file before and after docx save
Modified example file before and its modified docx version

Description Telesto 2020-12-20 20:18:49 UTC
Description:
One image out of line after DOCX export

Steps to Reproduce:
1. Open the attached file
2. Save as DOCX
3. File reload

Actual Results:
One image jumps out of alignment

Expected Results:
Same as ODT


Reproducible: Always


User Profile Reset: No



Additional Info:
Found in 
7.2

and in
4.4.7.2

and in
4.2

additional wrong positioned image with
4.1

alignment off with
4.0
Comment 1 Telesto 2020-12-20 20:19:13 UTC
Created attachment 168360 [details]
Example file
Comment 2 Telesto 2020-12-20 20:24:42 UTC
Also in
LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 3 Gabor Kelemen (allotropia) 2020-12-22 19:28:58 UTC
Created attachment 168429 [details]
The example file and its docx version in current master

Something is off after docx export in:

Version: 7.2.0.0.alpha0+
Build ID: e57665ea6f812aff9fc87073ce947f40a8b26e9d
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 4 Gabor Kelemen (allotropia) 2020-12-22 19:44:04 UTC
Created attachment 168430 [details]
Modified example file before and after docx save

Adding some colorful borders to the bottom row shows that all of them are moved a bit to the right.
Comment 5 Gabor Kelemen (allotropia) 2020-12-22 20:17:51 UTC
Created attachment 168431 [details]
Modified example file before and its modified docx version

Looks like the problem stems from the anchoring position of the bottom row:
the first three images are anchored to the third 24 pt paragraph while the other five are anchored to the second 24 pt paragraph.

Writer seems to consider the second paragraph (but not the third - strange) wrapped around the other images, and adds the wrapped images width to the horizontal position of the five images in case of docx.

Manually changing their horizontal position from "Paragraph area" to "Left paragraph border" fixes the right shift and restores the original layout.

See bug #138782 about this.
Comment 6 Attila Bakos (NISZ) 2021-05-05 06:30:37 UTC

*** This bug has been marked as a duplicate of bug 138782 ***