[Libreoffice-commits] core.git: sw/qa
Xisco Fauli (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jul 31 08:26:33 UTC 2020
sw/qa/extras/ooxmlexport/data/tdf81567.odt |binary
sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 28 ++++++++++++++++++++++++++++
2 files changed, 28 insertions(+)
New commits:
commit 3ac9c33a93a04d3e3192a6a31c0c07d76c02b311
Author: Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Fri Jul 31 01:45:18 2020 +0200
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Fri Jul 31 10:25:57 2020 +0200
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 at libreoffice.org>
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
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf81567.odt 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");
More information about the Libreoffice-commits
mailing list