summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2024-02-28 14:18:44 -0500
committerJustin Luth <jluth@mail.com>2024-03-01 01:38:13 +0100
commitc4c5937a98572630915de497b3138164b12079e3 (patch)
tree40caa566a0ac397e5770d56b26070a2ceb54778a /sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
parent9aa7dc185af99a540926cc699193449177050386 (diff)
tdf#159158 writerfilter: headers always behind text (!opaque)
If the body-anchored thing is in the background, then if any header stuff was NOT in the background, then it would show up above the body thing, and that should not happen in a DOCX world. This test was not easy to produce. ODT kind of knows that headers are special, and so it tries really hard to put stuff in the background without any wrap - at least after a round-trip. So I had to hand-craft from my example DOCX that exhibited a behindDoc which actually had some wrapping component to it. make CppunitTest_sw_ooxmlexport18 \ CPPUNIT_TEST_NAME=testTdf159158_zOrder_headerBehind2 Change-Id: I31617cd7bf2d38add2233a7a06ffe9a8ec00ec0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164130 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sw/qa/extras/ooxmlexport/ooxmlexport18.cxx')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport18.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
index 91fa26ea0a47..cb41f033730d 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -1047,6 +1047,23 @@ DECLARE_OOXMLEXPORT_TEST(testTdf159158_zOrder_headerBehind, "tdf159158_zOrder_he
CPPUNIT_ASSERT_EQUAL(OUString("RectangleInBody"), getProperty<OUString>(zOrder1,"Name"));
}
+DECLARE_OOXMLEXPORT_TEST(testTdf159158_zOrder_headerBehind2, "tdf159158_zOrder_headerBehind2.docx")
+{
+ // given a logo (marked as behind text) anchored in the header
+ // and an overlapping blue rectangle anchored in the body text.
+ uno::Reference<beans::XPropertySet> zOrder0(getShape(1), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> zOrder1(getShape(2), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(zOrder0, "ZOrder")); // lower
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty<sal_Int32>(zOrder1, "ZOrder")); // higher
+ CPPUNIT_ASSERT_EQUAL(OUString("HeaderImage"),
+ getProperty<OUString>(zOrder0, "LinkDisplayName"));
+ CPPUNIT_ASSERT_EQUAL(OUString("BodyBlueRectangle"),
+ getProperty<OUString>(zOrder1,"LinkDisplayName"));
+ // The logo should not be opaque since it is in the header.
+ CPPUNIT_ASSERT(!getProperty<bool>(zOrder0, "Opaque")); // logo should be invisible
+ CPPUNIT_ASSERT(!getProperty<bool>(zOrder1, "Opaque"));
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf155903, "tdf155903.odt")
{
// Without the accompanying fix in place, this test would have crashed,