Created attachment 170929 [details] Example with image control and custom shape The attached document has an image control and a custom shape. Control shapes are always in front of other objects, because they are automatically put to layer "Controls" and this layer has the special property to show its content always in front. Click on the custom shape and use "Bring to front". You notice, that this is not possible in relationship to the image control. Save the file, unpack it and examine content.xml. Notice, that the custom shape has a higher z-index as the form control, although the form control has been in front. Expected: The form control has a higher z-index than the custom shape for to reflect the visual appearance.
Created attachment 170935 [details] Shape vs Control The same problem is in Calc. If you switch to form edit mode and you select the arrow, you can see, that part of the arrow is behind the control. But in file format the control has index 0 and the arrow index 1. I know as long as we treat controls this way, we cannot reflect the z-index on import, but we can write it that way to file, that controls always have higher z-index to correspond to the way we render it.
Michael Stahl committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/79ef3c7ae3b2f7be5ba6fe38997e846fd9c7e0ee tdf#141467 xmloff,sc,sw: ODF export: reorder flys' ZOrder/z-index harder 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.
fixed on master