Bug 120760 - FILEOPEN Z-order of objects in attached DOCX is wrong
Summary: FILEOPEN Z-order of objects in attached DOCX is wrong
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: All All
: medium normal
Assignee: Szabolcs Toth
URL:
Whiteboard: target:7.1.0 target:7.0.2 target:24.8.0
Keywords: bibisected, filter:docx, regression
: 128373 (view as bug list)
Depends on:
Blocks: DOCX-Header-Footer WPS-Support Z-Order
  Show dependency treegraph
 
Reported: 2018-10-21 23:50 UTC by Aron Budea
Modified: 2024-01-22 13:05 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample DOCX (39.47 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-10-21 23:50 UTC, Aron Budea
Details
Comparison screenshot (50.20 KB, image/png)
2018-10-21 23:50 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2018-10-21 23:50:12 UTC
Created attachment 145883 [details]
Sample DOCX

The attached DOCX (created in Word) contains two images and a text box in the header.
One image is the page background (light blue), and should be behind the others (a red box and text box with green background).

=> It's shown in front instead (except the text in the text box). It's a Z-order bug, because if the image Picture 2 (the background) is deleted in the Navigator, the others are shown.

Observed using LO 6.2.0.0.alpha0+ (2018-10-09, 425af6845ebe066c950b0b63f50563e067485f3e) & 4.4.0.3 / Windows 7.
In 4.0.0.3 the text box is completely in front of the background, that perhaps could be bibisected.
In 3.5.0.3 the red image is in front of the background.
Comment 1 Aron Budea 2018-10-21 23:50:47 UTC
Created attachment 145884 [details]
Comparison screenshot
Comment 2 Xisco Faulí 2018-10-22 07:26:43 UTC
Hello Aron,
I've bisected the problem with the green textbox and it points to 57450afb768c085df0ba2344aa94b5f843060178, which is already mentioned in other bugs -> https://bugs.documentfoundation.org/buglist.cgi?quicksearch=57450afb768c085df0ba2344aa94b5f843060178&list_id=849841
Regarding the red shape, I think it's inherit from OOo
I let you decide what to do with this issue...
Comment 3 Aron Budea 2018-10-22 21:38:04 UTC
Thanks for the bisect, Xisco! Since wps support was new development, these days I'm inclined to not regard that as a regression, but as implementationError.

The issue with Z-order of the red image was introduced in the following range (bibisected using repo bibisect-43all:
https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=83837d6514217c82ebe8d56dddf89fa34f4b5435..2815396a1813cb3956c5aba066de49a7f34bc657

I'm inclined to think either of the following commits from Cedric are responsible:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=da53c44d7074499db2d0ba57eee09bde6152e7ea
author		Cédric Bosdonnat <cedric.bosdonnat@free.fr>	2012-07-31 14:46:59 +0200
committer	Cédric Bosdonnat <cedric.bosdonnat@free.fr>	2012-07-31 15:22:23 +0200
n#772094: pictures was eaten by document default LR settings

https://cgit.freedesktop.org/libreoffice/core/commit/?id=ae126d43e4737ab39e53827d9ad3bd6983577b1f
author		Cédric Bosdonnat <cedric.bosdonnat@free.fr>	2012-07-31 15:19:23 +0200
committer	Cédric Bosdonnat <cedric.bosdonnat@free.fr>	2012-07-31 15:22:23 +0200

n#772094: writerfilter, pictures anchored in header/footer won't be opaque
Comment 4 Commit Notification 2020-07-15 11:12:08 UTC
Szabolcs Toth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6479096dc2bd40215ff80273b4d27cadb2688cb1

tdf#120760 DOCX shape import: fix Z-order with behindDoc

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 5 NISZ LibreOffice Team 2020-07-21 12:57:58 UTC
*** Bug 128373 has been marked as a duplicate of this bug. ***
Comment 6 Xisco Faulí 2020-09-08 10:35:50 UTC
Verified in

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

@Szabolcs Toth, thanks for fixing this issue!
Comment 7 Commit Notification 2020-09-08 10:36:59 UTC
Szabolcs Toth committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/7739740ab36a933a134996427132c64dfddac49c

tdf#120760 DOCX shape import: fix Z-order with behindDoc

It will be available in 7.0.2.

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 8 Commit Notification 2024-01-22 13:05:27 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/12ea98fe637eda5f038b6447a5f0c5ea7104f448

tdf#159158 tdf#120760 DOCX shape import: fix Z-order with behindDoc #2

It will be available in 24.8.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.