Created attachment 145885 [details] Sample DOC The attached DOC (created in Word) contains two images and a text box in the header, and was saved from bug 120760's bugdoc in Word. 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 (results are slightly different compared to bug 120760). 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) & 3.3.0 / Windows 7.
Created attachment 145886 [details] Comparison screenshot
confirm with Version: 6.2.0.0.alpha1+ Build ID: 8274c4c62df5b937b3f0bec9e1eeca85f3b219d4 CPU threads: 8; OS: Linux 4.14; UI render: default; VCL: kde4; TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2018-10-22_00:35:58 Locale: nl-BE (en_US.UTF-8); Calc: threaded Version: 6.2.0.0.alpha0+ Build ID: aa3b2f90a62678c8e594830277a32e3ad742e826 CPU threads: 8; OS: Linux 4.14; UI render: default; VCL: kde4; Locale: nl-BE (en_US.UTF-8); Calc: threaded But not with Version: 6.1.4.0.0+ Build ID: ac39aba9b2d08b061b0eef651f5ebc7a84391171 CPU threads: 8; OS: Linux 4.14; UI render: default; VCL: kde4; Locale: nl-BE (en_US.UTF-8); Calc: group threaded
Thanks for checking, Xavier! I'd be surprised if this was actually fine in 6.1, but not in master, so that result seems fishy.
Also checked with 6.1.4.0.0+ daily build (2018-10-23, 5de85be43198804573787d4186b156b5931c4a9f), and I'm still only seeing the background, so the bug is still there. Let's set the bug to NEW.
Dear Aron Budea, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
// #i14045# MM If we are in a header or footer then make the object transparent // Not exactly like word but close enough for now const bool bMoveToBackgrd = pRecord->bDrawHell || ( ( m_bIsHeader || m_bIsFooter ) && pF->nwr == 3 ); if ( bMoveToBackgrd ) aFlySet.Put(SvxOpaqueItem(RES_OPAQUE,false));
Unfortunately there is no documentation in the code that indicates what determines z-order in DOC files, nor what determines zorder in LO. So we are left guessing as to whether the implementation is generally correct. Inserting these three items in reverse order seems to fix the problem (and no unit tests fail either), but based on a code read, I would expect that the code is correct too. Confusing! DOCX supposedly has something like "relativeHeight=“251657728"”, but that doesn't exist when I round-trip this example as DOCX (but it does have z-index, which is what is used in this case.) My guess (which may be entirely wrong) is that DOC has zorder similar to DOCX. But I see no evidence that this is actually being used. Our implementation seems to be simply based on the order in which the shape is read from the document, with the first read as the lowest zorder. LO seems to use 0-n, where 0 is the lowest zorder. And that seems like exactly what is happening for attachment 145885 [details]. But I notice something very strange. I expect that the IDs from DOCX will match DOC (because that is true for the example documents that I made to try to test my ideas), but in this case they are the opposite! DOCX - item - DOC 2049 - Text Box 2 - 2051 2050 - Picture 1 - 2050 2051 - Picture 2 - 2049
The key is that the blue shape was marked as "in background" while the other shapes were "before text". Amazingly, there was nothing in the existing shape ordering that put background shapes behind foreground shapes. proposed fix at https://gerrit.libreoffice.org/c/core/+/113837
Oops - had the wrong bug numbering in the patch summary. 7.2 patch applied with https://cgit.freedesktop.org/libreoffice/core/commit/?id=32013f0dccde8407aa907112399dc2a9efb7f906
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a6e271621843f454d92bc2c73a4425ad4afd1211 tdf#120761 doc import: fix z-order background logic It will be available in 7.2.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.
Another fix: https://cgit.freedesktop.org/libreoffice/core/commit/?id=a0d4955ba650ace35b7fd411a9670be1032e6982
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/eef7fab8962b74da7e6bb1d4fee8a54f95e6594b tdf#120761: sw_ww8import: fix typo in unittest It will be available in 7.2.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.
*** Bug 48715 has been marked as a duplicate of this bug. ***