summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/extras/ooxmlexport/ooxmlexport10.cxx')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport10.cxx21
1 files changed, 16 insertions, 5 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index 9c29fd434dd9..e5af806f373b 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -1752,14 +1752,25 @@ 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;
+ 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);
}