Bug 137698 - FILEOPEN DOCX: rectangle position images positioned wrong on file open
Summary: FILEOPEN DOCX: rectangle position images positioned wrong on file open
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.4 all versions
Hardware: All All
: medium normal
Assignee: Miklos Vajna
URL:
Whiteboard: target:7.1.0 target:7.0.4
Keywords: bibisected, bisected, regression
: 137551 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-10-23 08:26 UTC by Telesto
Modified: 2020-11-10 09:58 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Comparison MSO 2010 and LibreOffice 7.1 master (191.76 KB, image/png)
2020-10-27 11:28 UTC, Xisco Faulí
Details
The document in Word 2013 (60.39 KB, image/png)
2020-10-29 13:53 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2020-10-23 08:26:00 UTC
Description:
FILEOPEN DOCX: rectangle position images positioned wrong on file open

Steps to Reproduce:
1. Open attachment 166495 [details] (bug 137551)

Actual Results:
Images not visible

Expected Results:
Should be so


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.0.0.alpha0+ (x64)
Build ID: 94e6e140491de31c0788c91af855a75a3bb12709
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: default; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL
Comment 1 Telesto 2020-10-23 09:02:50 UTC
Also in
Version: 5.4.0.0.alpha1+
Build ID: 9feb7f7039a3b59974cbf266922177e961a52dd1
CPU threads: 4; OS: Windows 6.29; UI render: GL; 
Locale: nl-NL (nl_NL); Calc: CL

but not in
4.4.7.2
Comment 2 Telesto 2020-10-23 09:04:44 UTC
Problem being 'caused' by they Colton Loewen textbox (delete it and will look OK)
Comment 3 Xisco Faulí 2020-10-27 11:28:32 UTC
Created attachment 166769 [details]
Comparison MSO 2010 and LibreOffice 7.1 master
Comment 4 Xisco Faulí 2020-10-27 11:28:56 UTC
Reproduced in

Version: 7.1.0.0.alpha1+
Build ID: 0f0a5b63b19196f9463149a0a1991704c940efe2
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 5 Xisco Faulí 2020-10-27 11:44:10 UTC
The orange rectangle on the top right corner disappeared after

https://cgit.freedesktop.org/libreoffice/core/commit/?id=af313fc149f80adb0f1680ca20e19745ccb7fede

author	Miklos Vajna <vmiklos@collabora.co.uk>	2017-01-06 13:49:06 +0100
committer	Jan Holesovsky <kendy@collabora.com>	2017-01-06 15:14:50 +0000
commit af313fc149f80adb0f1680ca20e19745ccb7fede (patch)
tree 41473579cea4f6b39310bf8747249b68e4fa52af
parent 600f22fa3e718c36f3d8f47710df1dbbe0d0c4c2 (diff)
tdf#105143 DOCX import: enable DoNotCaptureDrawObjsOnPage layout compat option

Bisected with: bibisect-linux-64-5.4

Adding Cc: to Miklos Vajna
Comment 6 NISZ LibreOffice Team 2020-10-29 13:53:23 UTC
Created attachment 166846 [details]
The document in Word 2013

A fun little detail is that they put a first paragraph into this document with a spacing before value of 1852,5 pt so that the second paragraph goes to the second page.

Since Writer does not support more than 10 cm spacing before/after, this is incorrectly imported as 0 and the two empty paragraphs show up next to the top left textbox.

The narrow vertical shape and the top right shape happen to be anchored to the first paragraph of the document, and since their position is an absolute cm value right of column in Word, this is imported as "Left from Paragraph area", it's counted from the paragraph mark. 
Which is now placed at the right side of the top left Colton shape. So the orange shapes are positioned more to the right exactly by the width of that shape.
Comment 7 Telesto 2020-10-29 15:14:58 UTC
*** Bug 137551 has been marked as a duplicate of this bug. ***
Comment 8 Miklos Vajna 2020-11-03 14:32:51 UTC
> Since Writer does not support more than 10 cm spacing before/after

This is silly, the paragraph top margin is documented to take (signed) 32bit mm100 values on the UNO API, so this should not happen. I'll take a look.
Comment 9 Miklos Vajna 2020-11-10 08:06:11 UTC
Updating manually, I forgot to mention the bug number in the commit message:

Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/0afba07a597bf1d361624e10968855a802b859a0

DOCX import: fix <w:spacing w:before="..."/> for more than 58cm

It will be available in 7.1.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 NISZ LibreOffice Team 2020-11-10 08:57:35 UTC
(In reply to Miklos Vajna from comment #8)
> > Since Writer does not support more than 10 cm spacing before/after
> 
> This is silly, the paragraph top margin is documented to take (signed) 32bit
> mm100 values on the UNO API, so this should not happen. I'll take a look.

Thanks in advance :).

We have:
* bug #68335 for line spacing being limited to 10 cm (docx example: bug #103206)
* bug #72516 for below line spacing being limited to 10 cm (docx example: bug #122628) 
* this one about spacing before being > 10 cm in docx

I hope all three of these are just arbitrary limitations from the old days that can be erased easily :).
Comment 11 Xisco Faulí 2020-11-10 09:48:20 UTC
Verified in

Version: 7.1.0.0.alpha1+
Build ID: 03cafc2ab6b1678f82e9a30b6f81e505660ee702
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

@Miklos, thanks for fixing this issue!!
Comment 12 Commit Notification 2020-11-10 09:58:31 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/3f765ee646cbbf9f5738aaee4c478e930fe1af8d

tdf#137698 DOCX import: fix <w:spacing w:before="..."/> for more than 58cm

It will be available in 7.0.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.