summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2017-11-02 19:53:53 +0100
committerSzymon Kłos <szymon.klos@collabora.com>2017-11-14 16:49:30 +0100
commita3a917748892a6a3194ebfc4db64cfd764cc054a (patch)
tree5c314606ace2b7d2712f4ffe3ef342657aeeac52 /sw/qa
parente128d83b5e7fd2ceb8d5ec9a346a3b7351be79cc (diff)
tdf#113037 DOCX Watermark correct ratio
Import and export Watermark with padding like MSO does. Shape is scaled to save correct ratio. Change-Id: Iebd8eb5f168e0030320406d4fd6b287e451267bd Reviewed-on: https://gerrit.libreoffice.org/44319 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/extras/ooxmlexport/data/watermark.docxbin14766 -> 19473 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport10.cxx18
2 files changed, 18 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/watermark.docx b/sw/qa/extras/ooxmlexport/data/watermark.docx
index 8e279e3e857f..98c305af8cab 100644
--- a/sw/qa/extras/ooxmlexport/data/watermark.docx
+++ b/sw/qa/extras/ooxmlexport/data/watermark.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index 5498eb4f1a02..725209aab686 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -8,6 +8,7 @@
*/
#include <memory>
+#include <sstream>
#include <config_test.h>
#include <swmodeltestbase.hxx>
@@ -61,6 +62,7 @@
#include <unotools/streamwrap.hxx>
#include <comphelper/propertysequence.hxx>
#include <svx/svdpage.hxx>
+#include <editeng/unoprnms.hxx>
#include <bordertest.hxx>
@@ -1714,6 +1716,22 @@ DECLARE_OOXMLEXPORT_TEST( testObjectCrossReference, "object_cross_reference.odt"
CPPUNIT_ASSERT_EQUAL(sal_uInt16(21), nIndex);
}
+DECLARE_OOXMLEXPORT_TEST(testWatermark, "watermark.docx")
+{
+ uno::Reference<drawing::XShape> xShape(getShape(1), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(xShape, uno::UNO_QUERY);
+
+ sal_Int32 nTotalHeight = 0;
+ xPropertySet->getPropertyValue(UNO_NAME_TEXT_UPPERDIST) >>= nTotalHeight;
+ nTotalHeight += xShape->getSize().Height;
+
+ // Rounding errors
+ sal_Int32 nDifference = 5198 - nTotalHeight;
+ std::stringstream ss;
+ ss << "Difference: " << nDifference;
+ CPPUNIT_ASSERT_MESSAGE(ss.str(), nDifference <= 4);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */