tdf#133448: sw: Add unittest

Change-Id: I7089c56e5be0c0b8a8a23e0ebb1f64780c8d90ef
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95279
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
diff --git a/sw/qa/extras/ooxmlimport/data/tdf133448.docx b/sw/qa/extras/ooxmlimport/data/tdf133448.docx
new file mode 100644
index 0000000..d9e3af0
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf133448.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 343c08a..141a06e 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1345,6 +1345,19 @@
    CPPUNIT_ASSERT_EQUAL(sal_Int32(466), getProperty<sal_Int32>(xFrame, "Height"));
}

DECLARE_OOXMLIMPORT_TEST(testTdf133448, "tdf133448.docx")
{
    auto xGraphic = getProperty<uno::Reference<graphic::XGraphic>>(getShape(1), "Graphic");
    Graphic aGraphic(xGraphic);
    uno::Reference<beans::XPropertySet> 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<drawing::XShape> xShape = getShape(1);