diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2017-11-02 19:53:53 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-12-07 13:16:15 +0100 |
commit | 3e4e3ee3dba7fa65263e71da0bc0091d4e950d33 (patch) | |
tree | e8cf0c8bb2c9fcdf16c78c54c8b745dfde7d431f /sw/qa | |
parent | fec53ea4c33b012ef76d971d0b154d766c8e5759 (diff) |
tdf#113037 DOCX Watermark correct ratio
Import and export Watermark with padding like MSO does.
Shape is scaled to save correct ratio.
Reviewed-on: https://gerrit.libreoffice.org/44319
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
(cherry picked from commit a3a917748892a6a3194ebfc4db64cfd764cc054a)
Change-Id: Iebd8eb5f168e0030320406d4fd6b287e451267bd
Reviewed-on: https://gerrit.libreoffice.org/45995
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/watermark.docx | bin | 14766 -> 19473 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 17 |
2 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/watermark.docx b/sw/qa/extras/ooxmlexport/data/watermark.docx Binary files differindex 8e279e3e857f..98c305af8cab 100644 --- a/sw/qa/extras/ooxmlexport/data/watermark.docx +++ b/sw/qa/extras/ooxmlexport/data/watermark.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 14731d28dbfa..9740bc954397 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -31,6 +31,7 @@ #include <ftninfo.hxx> #include <sfx2/docfile.hxx> #include <sfx2/docfilt.hxx> +#include <editeng/unoprnms.hxx> class Test : public SwModelTestBase { @@ -601,6 +602,22 @@ DECLARE_OOXMLEXPORT_TEST(testTdf67207_MERGEFIELD, "mailmerge.docx") CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.text.fieldmaster.DataBase.Name"), sValue); } +DECLARE_OOXMLEXPORT_TEST(testWatermarkSize, "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: */ |