From 39c08074a286855dd014ce1c30b8f7ef95b10242 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Fri, 18 Aug 2017 15:13:52 +0200 Subject: Watermark: not visible if page background was set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Watermark was drawn under the page background. It has to be placed on the upper layer to be visible. Change-Id: I132a313eed6fb712aafdca14a38fe559aa4231c8 Reviewed-on: https://gerrit.libreoffice.org/41289 Tested-by: Jenkins Reviewed-by: Szymon Kłos --- sw/qa/extras/ooxmlexport/data/watermark-layer.docx | Bin 0 -> 17964 bytes sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 14 ++++++++++++++ 2 files changed, 14 insertions(+) create mode 100755 sw/qa/extras/ooxmlexport/data/watermark-layer.docx (limited to 'sw/qa/extras') diff --git a/sw/qa/extras/ooxmlexport/data/watermark-layer.docx b/sw/qa/extras/ooxmlexport/data/watermark-layer.docx new file mode 100755 index 000000000000..9428686c1bad Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/watermark-layer.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 4e961079b829..515f40e4803b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -30,8 +30,10 @@ #include #include +#include #include #include +#include class Test : public SwModelTestBase { @@ -993,6 +995,18 @@ DECLARE_OOXMLEXPORT_TEST(testActiveXControlAtRunEnd, "activex_control_at_run_end CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER,getProperty(xPropertySet2,"AnchorType")); } +DECLARE_OOXMLEXPORT_TEST(testWatermarkLayer, "watermark-layer.docx") +{ + // Watermark was not visible if page background was set. + + SwXTextDocument* pTextDoc = dynamic_cast(mxComponent.get()); + SdrPage* pPage = pTextDoc->GetDocShell()->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0); + SdrObject* pObject = pPage->GetObj(0); + + CPPUNIT_ASSERT(pObject); + CPPUNIT_ASSERT_EQUAL(static_cast(1), pObject->GetLayer().get()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit