diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2021-03-08 20:03:35 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-03-15 10:15:57 +0100 |
commit | 9bc6160e0acbc78be998129ea55ed7e4529959fa (patch) | |
tree | d07f099dbf264a24c4d291997637fc49d5ebbf96 /sw/qa/extras/odfexport | |
parent | bfa320ef2ac7ab9a84f86eee6dfa7f3ee67fa630 (diff) |
tdf#133487 sw ODF export: reorder flys' ZOrder/z-index...
... so background shapes have lower z-index than foreground shapes,
as is recommended by ODF 1.3.
Also let SdrObjList::sort() record Undo actions, because earlier Undo
actions could expect the previous sort order.
Change-Id: Idbecf0a2acd525d42efc0ac92677b1c7987cc6ad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112180
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/qa/extras/odfexport')
-rw-r--r-- | sw/qa/extras/odfexport/data/MadeByLO7.odt | bin | 0 -> 17354 bytes | |||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 14 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/extras/odfexport/data/MadeByLO7.odt b/sw/qa/extras/odfexport/data/MadeByLO7.odt Binary files differnew file mode 100644 index 000000000000..9587fffe6470 --- /dev/null +++ b/sw/qa/extras/odfexport/data/MadeByLO7.odt diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 7e49bbd1b048..285da20616e0 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -232,6 +232,20 @@ DECLARE_ODFEXPORT_TEST(testTdf130314, "tdf130314.docx") CPPUNIT_ASSERT_EQUAL(2, getPages()); } +DECLARE_ODFEXPORT_EXPORTONLY_TEST(testTdf133487, "MadeByLO7.odt") +{ + xmlDocUniquePtr pXmlDoc = parseExport("content.xml"); + // shape in background 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", "background"); + // shape in foreground, previously index 1 + assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[1]/draw:custom-shape", "z-index", "2"); + assertXPath(pXmlDoc, "/office:document-content/office:automatic-styles/style:style[@style:name = /office:document-content/office:body/office:text/text:p[1]/draw:custom-shape[@draw:z-index = '2']/attribute::draw:style-name]/style:graphic-properties", "run-through", "foreground"); + // shape in foreground, previously index 0 + assertXPath(pXmlDoc, "/office:document-content/office:body/office:text/text:p[3]/draw:custom-shape", "z-index", "1"); + 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_TEST(testTdf139126, "tdf139126.odt") { CPPUNIT_ASSERT_EQUAL(1, getPages()); |