summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-08-23 19:02:12 -0400
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-08-28 17:53:41 +0200
commitd21f67fa7fd0360688e083eeb2bbcd57f5414d71 (patch)
tree36a2b57d26bb2d7095796ca1be65371994eb37d6 /sw/qa
parent4b8214414b8713e8a969655494a244d117cb14af (diff)
tdf#111895 writerfilter: avoid hiding shapes behind background
In MSO, page background is "in hell" zOrder, however in LO, page background is at the same zOrder as the text, so avoid hiding shapes behind the page background unless doing so would hide text. When importing gradients/pattern/hatch backgrounds are supported, HasPageBackground will need to be expanded to include those as well. Change-Id: I4496fd3f4c644ac9ac1854090658017078ce3e88 Reviewed-on: https://gerrit.libreoffice.org/41486 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf111895_foregroundShape.docxbin0 -> 62173 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf111895_foregroundShape2.docxbin0 -> 60809 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport9.cxx16
3 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf111895_foregroundShape.docx b/sw/qa/extras/ooxmlexport/data/tdf111895_foregroundShape.docx
new file mode 100644
index 000000000000..b282059b1097
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf111895_foregroundShape.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf111895_foregroundShape2.docx b/sw/qa/extras/ooxmlexport/data/tdf111895_foregroundShape2.docx
new file mode 100644
index 000000000000..ae2e3c7573db
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf111895_foregroundShape2.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
index a8abe8489c57..3867f468649b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx
@@ -229,6 +229,22 @@ DECLARE_OOXMLEXPORT_TEST(testTdf98700_keepWithNext, "tdf98700_keepWithNext.odt")
CPPUNIT_ASSERT_EQUAL_MESSAGE("Text Body style toggled off keep with next", false, getProperty<bool>(getParagraph(5), "ParaKeepTogether"));
}
+DECLARE_OOXMLEXPORT_TEST(testTdf111895_foregroundShape, "tdf111895_foregroundShape.docx")
+{
+ uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Light yellow background", sal_Int32(0xFFFF66), getProperty<sal_Int32>(xPageStyle, "BackColor"));
+ // despite a behindDoc==1, put shape in foreground since the page background would have hidden it otherwise.
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape is in front of page background", true, getProperty<bool>(getShape(1), "Opaque"));
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf111895_foregroundShape2, "tdf111895_foregroundShape2.docx")
+{
+ uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Light yellow background", sal_Int32(0xFFFF66), getProperty<sal_Int32>(xPageStyle, "BackColor"));
+ // despite a page background, don't show behindDoc==1 shape in front since it would have hidden wrap_THROUGH text.
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Shape is in front of page background", false, getProperty<bool>(getShape(1), "Opaque"));
+}
+
// base class to supply a helper method for testHFLinkToPrev
class testHFBase : public Test
{