Bug 81956 - FILEOPEN: Z-ordering of GroupShape not preserved properly for docx file.
Summary: FILEOPEN: Z-ordering of GroupShape not preserved properly for docx file.
Status: NEW
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: Not Assigned
URL:
Whiteboard: BSA
Keywords: filter:docx
Depends on:
Blocks: VML-Shapes Z-Order
  Show dependency treegraph
 
Reported: 2014-07-31 09:59 UTC by Sushil Shinde
Modified: 2024-01-18 23:14 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Attached file contain two images. (43.23 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2014-07-31 09:59 UTC, Sushil Shinde
Details
Comparison between Word 2010 (left) and Libreoffice 5.0.0.5 (right) (53.41 KB, image/jpeg)
2015-08-20 12:46 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sushil Shinde 2014-07-31 09:59:11 UTC
Created attachment 103740 [details]
Attached file contain two images.

Problem description: In attached file there are two images. In original file first image is behind of second image. But on LO rendered second image behind of first image and exported the same.

Steps to reproduce:
1. Open attached file on latest LO master
2. Save file as docx file again.
3. Open saved file on MS Office

Current behavior:
Z-ordering is rendered/saved incorrectly.

Expected behavior:
LO should render and save z-order properly.

              
Operating System: Ubuntu
Version: 4.4.0.0.alpha0+ Master
Comment 1 Jorendc 2014-07-31 12:03:03 UTC
Synerzip -> NEW
Comment 2 Xisco Faulí 2015-08-20 12:46:57 UTC
Created attachment 118043 [details]
Comparison between Word 2010 (left) and Libreoffice 5.0.0.5 (right)

Problem still present in

Version: 5.0.0.5
Build ID: 1b1a90865e348b492231e1c451437d7a15bb262b
Locale: es-ES (es_ES)

on Windows 7 (64-bit)
Comment 3 QA Administrators 2016-09-20 10:26:05 UTC Comment hidden (obsolete)
Comment 4 Regina Henschel 2017-07-17 13:15:24 UTC
The problem is still present in Version: 5.4.0.0.alpha1+
Build-ID: 8c0be54a7da6262dffe04357121814dd22b5d7fe
CPU-Threads: 4; Betriebssystem:Windows 6.1; UI-Render: Standard; 
TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2017-05-15_01:35:45
Gebietsschema: de-DE (de_DE); Calc: group

and in

Version: 6.0.0.0.alpha0+
Build ID: 9f3814af7264ce90685a82cbf4eb015a38f22bf7
CPU threads: 4; OS: Windows 6.1; UI render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2017-06-28_00:47:42
Locale: de-DE (de_DE); Calc: group

It is an imported error.
Comment 5 Regina Henschel 2017-07-17 13:15:53 UTC Comment hidden (no-value)
Comment 6 Justin L 2017-11-02 14:00:06 UTC
The rose-rings image is placed inside of a textbox (so it gets placed in the foreground instead of the background during import). The 30-image is grouped with various shapes and bits.

If anyone decides to waste their time with this one, also noticed that in LO the people have a transparent background (so that the rings show up behind them), while in MSWord the background is solid white.
Comment 7 QA Administrators 2018-11-03 03:51:00 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2022-09-30 03:53:52 UTC Comment hidden (obsolete)
Comment 9 Stéphane Guillou (stragu) 2024-01-12 12:36:42 UTC
reproduced in recent trunk build:

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 3cb1ed4339fc9aec414c0f112a69705a7a4d9cc6
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Using "bring to front" on the People/30 image doesn't even bring it in front of the flower image.
Note that the People/30 image isn't even listed in the Navigator.
Comment 10 Stéphane Guillou (stragu) 2024-01-12 12:46:33 UTC
(In reply to Stéphane Guillou (stragu) from comment #9)
> Using "bring to front" on the People/30 image doesn't even bring it in front
> of the flower image.
That's because it's in the background. It needs to be brought to the foreground first.
> Note that the People/30 image isn't even listed in the Navigator.
Its parts are visible once it's ungrouped (as drawing shapes).
Comment 11 Justin L 2024-01-12 17:53:40 UTC
the flower (MC900412450[1].WMF) has a z-index:251661312 and the two people/30 image (MC900283119[1].WMF) has a higher z-index:251672576, both of which are positive numbers when placed in a sal_Int32.

Likely the proper solution involves NOT letting the floating group shape go into the background? Why is it in the background anyway?
Comment 12 Justin L 2024-01-18 22:09:32 UTC
somewhere in between the 4.0.0 and 4.0.2 timeframe, the 30/couple object changed from being imported as an inline (as-character) thing to an in-the-background floating thing.
Comment 13 Justin L 2024-01-18 23:14:03 UTC
SimpleShape::createPictureObject looks like a good starting point to debug this.