diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2017-12-07 16:09:47 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-12-10 00:20:55 +0100 |
commit | 1aca81256407be27fd4a7e027e27c51486c2dc31 (patch) | |
tree | effdcd60e5bdc971283c4cd8d102e4d2d0f791f1 /sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | |
parent | ffe4d766a0bd9f3b936d6e742d26ca0f1e6554b4 (diff) |
tdf#114308 Export Watermark size as is
* refactoring
* removed size hack
* export/import "trim" attribute
* DOC: export set of parameters to fit shape & frame
Change-Id: Ib00654626ae1e10ac5110d22eada7528e03357e7
Reviewed-on: https://gerrit.libreoffice.org/46036
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/46154
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sw/qa/extras/ooxmlexport/ooxmlexport9.cxx')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport9.cxx | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx index 97a5098d2373..8d125bea4910 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport9.cxx @@ -607,14 +607,25 @@ 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; + sal_Int32 nHeight = xShape->getSize().Height; // Rounding errors - sal_Int32 nDifference = 5198 - nTotalHeight; + sal_Int32 nDifference = 5150 - nHeight; std::stringstream ss; - ss << "Difference: " << nDifference << " TotalHeight: " << nTotalHeight; + ss << "Difference: " << nDifference << " TotalHeight: " << nHeight; + CPPUNIT_ASSERT_MESSAGE(ss.str(), nDifference <= 4); + CPPUNIT_ASSERT_MESSAGE(ss.str(), nDifference >= -4); +} + +DECLARE_OOXMLEXPORT_TEST(testWatermarkTrim, "tdf114308.docx") +{ + uno::Reference<drawing::XShape> xShape(getShape(1), uno::UNO_QUERY); + + // Rounding errors + sal_Int32 nHeight = xShape->getSize().Height; + sal_Int32 nDifference = 8729 - nHeight; + std::stringstream ss; + ss << "Difference: " << nDifference << " TotalHeight: " << nHeight; CPPUNIT_ASSERT_MESSAGE(ss.str(), nDifference <= 4); CPPUNIT_ASSERT_MESSAGE(ss.str(), nDifference >= -4); } |