From 987de0769fc57ab66ae814e79aa2c4a522c81098 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Mon, 1 Jun 2020 13:21:41 +0200 Subject: tdf#133448: sw: Add unittest Change-Id: I7089c56e5be0c0b8a8a23e0ebb1f64780c8d90ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95279 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- sw/qa/extras/ooxmlimport/data/tdf133448.docx | Bin 0 -> 92038 bytes sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 13 +++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 sw/qa/extras/ooxmlimport/data/tdf133448.docx diff --git a/sw/qa/extras/ooxmlimport/data/tdf133448.docx b/sw/qa/extras/ooxmlimport/data/tdf133448.docx new file mode 100644 index 000000000000..d9e3af06817b Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf133448.docx differ diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 343c08a94d89..141a06e144cc 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1345,6 +1345,19 @@ DECLARE_OOXMLIMPORT_TEST(testTdf101627, "tdf101627.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(466), getProperty(xFrame, "Height")); } +DECLARE_OOXMLIMPORT_TEST(testTdf133448, "tdf133448.docx") +{ + auto xGraphic = getProperty>(getShape(1), "Graphic"); + Graphic aGraphic(xGraphic); + uno::Reference xGraphicDescriptor(xGraphic, uno::UNO_QUERY_THROW); + awt::Size aSizePixel; + CPPUNIT_ASSERT(xGraphicDescriptor->getPropertyValue("SizePixel") >>= aSizePixel); + + //Without the fix in place, the graphic's size is 0x0 + CPPUNIT_ASSERT_EQUAL(sal_Int32(837), aSizePixel.Width); + CPPUNIT_ASSERT_EQUAL(sal_Int32(598), aSizePixel.Height); +} + DECLARE_OOXMLIMPORT_TEST(testTdf100072, "tdf100072.docx") { uno::Reference xShape = getShape(1); -- cgit v1.2.3