OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

office message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: OFFICE-2122: @draw:z-index and @style:run-through on images within a <draw:frame>

Dear TC,

This is about the following JIRA issue: https://issues.oasis-open.org/browse/OFFICE-2122
You may find a summary at the end.

ODF applications involved
I have created a test document with Microsoft Office Professional Plus 2016 installation, Version 1705 (Build 8201.2102) to be able to have as well DOCX functionality at hands.
Aside I have been using a LibreOffice Writer both on a Windows 10 Home edition.

Test document description
The test document contains four images and fill text to place two images before and two behind it.
The images had been created with Microsoft PAINT. I simply have manually written "very behind", "behind", "before" and "very before" on them.
[I was slightly reminded of some Sesame Street lessons from childhood]

Creating the test document (in Word 2016)
I have added those images in Word via Insert->Pictures into the text and used the context menu on the image choosing "Wrap Text" for two images with following "Behind Text" and for the two others "in Front of Text".  The images were manually positioned to be overlapping, to see which one is above the other and sometimes I have corrected the wrong Z positioning again via the context menu on the image choosing "Bring to Front" or "Sent to Back".

After this, I have saved the document as DOCX and ODT.

NOTE: I am never able to edit XML files and save them within the office document with JEdit as I do with documents from other ODF applications when they are created by any Microsoft office. Therefore I had to neglect XML face-lifting. For instance, incidentally I had duplicated the "very behind" picture during a text copy, so there are 5 pictures in total.

XML of original Microsoft Document
As we expected the higher the draw:z-index the higher the altitude, raising finally over the image:
@draw:z-index="251658240" <=> very behind
@draw:z-index="251674624" <=> very behind
@draw:z-index="251677696" <=> behind
@draw:z-index="251678720" <=> before
@draw:z-index="251679744" <=> very before

As expected, the images behind the text a graphic style use
and those before the text a graphic style have

XML of imported MSO document within LibreOffice (and saved as ODT)
Both documents in ODT and DOCX being loaded into LibreOffice Writer look fine regarding the Z positioning, showing the same relations.
When the document is being saved as ODT again by the LO Writer it  keeps its relation still changes the Z positioning to
@draw:z-index="0" <=> very behind
@draw:z-index="1" <=> very behind
@draw:z-index="2" <=> behind
@draw:z-index="3" <=> before
@draw:z-index="4" <=> very before

and ONLY the images behind have an attribute 
@style:run-through, which contains at least as expected "background"
Please note that the spec is not mentioning a default value "foreground", but thinking it over it would make sense to name this as default.

Roundtrip Interoperability Issues
When this document is again being loaded with Word, strangely the order remains mostly the same, BUT the two very bottom pictures are becoming the two top pictures AND all images are behind the text. Strange bug!

Missing Test Coverage
NOTE: I have only more or less quickly tested the z-index for images within frames and not have tested any other frame content, nor did I tested on of the other 21 elements:
<dr3d:cube> 10.5.4
<dr3d:extrude> 10.5.6
<dr3d:rotate> 10.5.7
<dr3d:scene> 10.5.2
<dr3d:sphere> 10.5.5
<draw:caption> 10.3.11
<draw:circle> 10.3.8
<draw:connector> 10.3.10
<draw:control> 10.3.13
<draw:custom-shape> 10.6.1
<draw:ellipse> 10.3.9
<draw:g> 10.3.15
<draw:line> 10.3.3
<draw:measure> 10.3.12
<draw:page-thumbnail> 10.3.14
<draw:path> 10.3.7
<draw:polygon> 10.3.5
<draw:polyline> 10.3.4
<draw:rect> 10.3.2
<draw:regular-polygon> 10.3.6 and 
<office:annotation> 14.1.

Summary: A handful of things to point out
  1. We need more test documents to have a better coverage: Does some office vendors have a test base on this feature property they might be able to share?
  2. Only the ordering of the z-index values are of interest, not the values itself 
  3. As expected style:run-through="background" is being used to emulate a negative z-index. 
  4. If we do not want to improve the z-index as Dough suggested, we might still want to make the value "foreground" the default value of @style:run-through
  5. There is an interoperability issue when loading the Word document with Writer than saving it as ODT and loading it back with Word: The two pictures at the very bottom are now at the very top.

Kind regards,

Attachment: 4ImagesAndTextOverlapping_MSO-docx_LO-odt_MSO.odt
Description: application/vnd.oasis.opendocument.text

Attachment: 4ImagesAndTextOverlapping-MSO.docx
Description: application/vnd.openxmlformats-officedocument.wordprocessingml.document

Attachment: 4ImagesAndTextOverlapping-MSO.odt
Description: application/vnd.oasis.opendocument.text

Attachment: 4ImagesAndTextOverlapping_MSO-docx_LO.odt
Description: application/vnd.oasis.opendocument.text

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]