summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2024-06-07 15:37:32 -0400
committerJustin Luth <jluth@mail.com>2024-06-08 00:43:45 +0200
commitf714fb262ad8561afcababf4b7a97dedb1b72c15 (patch)
tree1b23c906b8b2c0614b0d578df0015d407ab085de /sw/qa
parent8ecdff7ac3e867b3e0e43a0df24695785abc5962 (diff)
tdf#100037 vml import: set fly-anchored AS_CHARs above fly's zOrder
Normally an AS_CHAR is the lowest in the heaven-layer zOrder, but if it is inside a fly, it should be just above the fly's zOrder. In order to get at the parent's properties, I had to remove the stack abstraction so I changed the stack to a vector. That seemed a lot saner than popping and re-pushing. make CppunitTest_sw_ooxmlexport18 \ CPPUNIT_TEST_NAME=testTdf100037_inlineZOrder2 make CppunitTest_sw_ooxmlexport18 \ CPPUNIT_TEST_NAME=testTdf100037_inlineZOrder3 Change-Id: Idc159e8203b3f304133a9b110c135e4d0f001dbc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168565 Reviewed-by: Justin Luth <jluth@mail.com> Tested-by: Jenkins
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf100037_inlineZOrder2.docxbin0 -> 150049 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf100037_inlineZOrder3.docxbin0 -> 150034 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport18.cxx44
3 files changed, 44 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf100037_inlineZOrder2.docx b/sw/qa/extras/ooxmlexport/data/tdf100037_inlineZOrder2.docx
new file mode 100644
index 000000000000..e30824ba10c8
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf100037_inlineZOrder2.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf100037_inlineZOrder3.docx b/sw/qa/extras/ooxmlexport/data/tdf100037_inlineZOrder3.docx
new file mode 100644
index 000000000000..d97bd7ecb291
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf100037_inlineZOrder3.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
index 50a9dc33e9e5..ff3e7a3bf6f6 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -1076,6 +1076,50 @@ DECLARE_OOXMLEXPORT_TEST(testTdf100037_inlineZOrder, "tdf100037_inlineZOrder.doc
CPPUNIT_ASSERT_EQUAL(OUString("Frame1"), getProperty<OUString>(zOrder1, "LinkDisplayName"));
}
+DECLARE_OOXMLEXPORT_TEST(testTdf100037_inlineZOrder2, "tdf100037_inlineZOrder2.docx")
+{
+ // given a yellow floating textbox-with-image overlapped by a blue textbox-with-image,
+ // the inline image should take its zOrder from the textbox it is in.
+ if (isExported())
+ return; // we don't export images inside of draw textboxes I guess
+
+ uno::Reference<beans::XPropertySet> zOrder0(getShape(1), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> zOrder1(getShape(2), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> zOrder2(getShape(3), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> zOrder3(getShape(4), 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"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(zOrder2, "ZOrder"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getProperty<sal_Int32>(zOrder3, "ZOrder")); // higher
+ // yellow textbox (Frame1) is the lowest
+ CPPUNIT_ASSERT_EQUAL(OUString("Frame1"), getProperty<OUString>(zOrder0, "LinkDisplayName"));
+ //CPPUNIT_ASSERT_EQUAL(OUString("Image1"), getProperty<OUString>(zOrder1, "Name"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Frame2"), getProperty<OUString>(zOrder2, "LinkDisplayName"));
+ // CPPUNIT_ASSERT_EQUAL(OUString("Image2"), getProperty<OUString>(zOrder3, "LinkDisplayName"));
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf100037_inlineZOrder3, "tdf100037_inlineZOrder3.docx")
+{
+ // given a yellow floating textbox-with-image that overlaps a blue textbox-with-image,
+ // the inline image should take its zOrder from the textbox it is in.
+ if (isExported())
+ return; // we don't export images inside of draw textboxes I guess
+
+ uno::Reference<beans::XPropertySet> zOrder0(getShape(1), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> zOrder1(getShape(2), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> zOrder2(getShape(3), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> zOrder3(getShape(4), 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"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(zOrder2, "ZOrder"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(3), getProperty<sal_Int32>(zOrder3, "ZOrder")); // higher
+ // blue textbox (Frame2) is the lowest
+ CPPUNIT_ASSERT_EQUAL(OUString("Frame2"), getProperty<OUString>(zOrder0, "LinkDisplayName"));
+ // CPPUNIT_ASSERT_EQUAL(OUString("Image2"), getProperty<OUString>(zOrder1, "LinkDisplayName"));
+ CPPUNIT_ASSERT_EQUAL(OUString("Frame1"), getProperty<OUString>(zOrder2, "LinkDisplayName"));
+ // CPPUNIT_ASSERT_EQUAL(OUString("Image1"), getProperty<OUString>(zOrder3, "LinkDisplayName"));
+}
+
DECLARE_OOXMLEXPORT_TEST(testTdf155903, "tdf155903.odt")
{
// Without the accompanying fix in place, this test would have crashed,