summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2020-07-31 01:45:18 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-07-31 10:25:57 +0200
commit3ac9c33a93a04d3e3192a6a31c0c07d76c02b311 (patch)
tree449d86c535710147877aefbbf1ce6447adc001ed /sw
parent6353c51e8bf66fe223080db649fc07e62a3a6c97 (diff)
tdf#81567 : sw_ooxmlexport14: Add unittest
Change-Id: Ib1584b8599b65c9a122768b7c00d7891efc6e920 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99824 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf81567.odtbin0 -> 10892 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport14.cxx28
2 files changed, 28 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf81567.odt b/sw/qa/extras/ooxmlexport/data/tdf81567.odt
new file mode 100644
index 000000000000..93e449754b03
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf81567.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
index 899e2646438b..129b93882c68 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
@@ -479,6 +479,34 @@ DECLARE_OOXMLEXPORT_TEST(testTdf78352, "tdf78352.docx")
CPPUNIT_ASSERT_LESS(150, nWidth);
}
+DECLARE_OOXMLEXPORT_TEST(testTdf81567, "tdf81567.odt")
+{
+ CPPUNIT_ASSERT_EQUAL(1, getPages());
+ CPPUNIT_ASSERT_EQUAL(2, getShapes());
+
+ int nFrameWidth = parseDump("/root/page/body/txt/anchored/fly/infos/bounds", "width").toInt32();
+ CPPUNIT_ASSERT_EQUAL(2371, nFrameWidth);
+
+ int nFrameHeight = parseDump("/root/page/body/txt/anchored/fly/infos/bounds", "height").toInt32();
+ CPPUNIT_ASSERT_EQUAL(3520, nFrameHeight);
+
+ int nFrameTop = parseDump("/root/page/body/txt/anchored/fly/infos/bounds", "top").toInt32();
+ CPPUNIT_ASSERT_EQUAL(1518, nFrameTop);
+
+ int nImageWidth = parseDump("/root/page/body/txt/anchored/fly/txt/anchored/fly/infos/bounds", "width").toInt32();
+ CPPUNIT_ASSERT_EQUAL(2370, nImageWidth);
+
+ int nImageHeight = parseDump("/root/page/body/txt/anchored/fly/txt/anchored/fly/infos/bounds", "height").toInt32();
+ CPPUNIT_ASSERT_EQUAL(1605, nImageHeight);
+
+ // Check the image is at the top of the frame
+ // Without the fix in place, this test would have failed with:
+ // - Expected: 1638
+ // - Actual : 2236
+ int nImageTop = parseDump("/root/page/body/txt/anchored/fly/txt/anchored/fly/infos/bounds", "top").toInt32();
+ CPPUNIT_ASSERT_EQUAL(1638, nImageTop);
+}
+
DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf92472, "tdf92472.docx")
{
xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");