From 79ef3c7ae3b2f7be5ba6fe38997e846fd9c7e0ee Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 6 Apr 2021 18:54:51 +0200 Subject: tdf#141467 xmloff,sc,sw: ODF export: reorder flys' ZOrder/z-index harder Also keep the control layer distinct from the foreground, as a follow-up to tdf#133487. Try to improve the detection of already sorted indexes a bit to avoid unnecessary sorting. Hilariously the test docs require adding 3 additional items to the extension schema. Change-Id: I629d5b09294f679717677b9d89537d905ac4c404 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113696 Tested-by: Jenkins Reviewed-by: Michael Stahl --- sw/qa/extras/odfexport/odfexport.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'sw/qa/extras/odfexport/odfexport.cxx') diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index f570e9f5d40a..6dc67ca58a1d 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -246,6 +246,18 @@ DECLARE_ODFEXPORT_EXPORTONLY_TEST(testTdf133487, "MadeByLO7.odt") assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[3]/draw:custom-shape[@draw:z-index = '1']/attribute::draw:style-name]/style:graphic-properties", "run-through", "foreground"); } +DECLARE_ODFEXPORT_EXPORTONLY_TEST(testTdf141467, "Formcontrol needs high z-index.odt") +{ + xmlDocUniquePtr pXmlDoc = parseExport("content.xml"); + // shape in foreground has lowest index + assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[2]/draw:custom-shape", "z-index", "0"); + assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[2]/draw:custom-shape[@draw:z-index = '0']/attribute::draw:style-name]/style:graphic-properties", "run-through", "foreground"); + // form control, previously index 0 + assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[2]/draw:control", "z-index", "1"); + // no run-through on form's style + assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[2]/draw:control[@draw:z-index = '1']/attribute::draw:style-name]/style:graphic-properties/attribute::run-through", 0); +} + DECLARE_ODFEXPORT_TEST(testTdf139126, "tdf139126.odt") { CPPUNIT_ASSERT_EQUAL(1, getPages()); -- cgit v1.2.3