summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2016-12-12 01:12:21 +0800
committerMark Hung <marklh9@gmail.com>2016-12-24 02:35:21 +0000
commitf05714c3527635bd78bf7ded7b7a160dbe3b4685 (patch)
treef00e6277dcd26215c1472ad8d8c148d9ccafc6fd
parent96b95f5010be090ebae6f755d4d3891a2334332c (diff)
tdf#101729 add test case to make sure that the text is inside the cell.
Change-Id: Icffbf20f7bbca3d645a769cc294a3fd7acb51d97 Reviewed-on: https://gerrit.libreoffice.org/31870 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mark Hung <marklh9@gmail.com>
-rwxr-xr-xsw/qa/extras/odfimport/data/tdf101729.odtbin0 -> 23049 bytes
-rw-r--r--sw/qa/extras/odfimport/odfimport.cxx10
2 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/extras/odfimport/data/tdf101729.odt b/sw/qa/extras/odfimport/data/tdf101729.odt
new file mode 100755
index 000000000000..3afd2d001afc
--- /dev/null
+++ b/sw/qa/extras/odfimport/data/tdf101729.odt
Binary files differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 9c21cad377b7..1500ff899d59 100644
--- a/sw/qa/extras/odfimport/odfimport.cxx
+++ b/sw/qa/extras/odfimport/odfimport.cxx
@@ -761,5 +761,15 @@ DECLARE_ODFIMPORT_TEST(testTdf75221, "tdf75221.odt")
CPPUNIT_ASSERT(top.toInt32() > 0);
}
+DECLARE_ODFIMPORT_TEST(testTdf101729, "tdf101729.odt")
+{
+ sal_Int32 l = parseDump("/root/page/body/tab/row/cell[1]/infos/bounds", "left").toInt32();
+ sal_Int32 w = parseDump("/root/page/body/tab/row/cell[1]/infos/bounds", "width").toInt32();
+ sal_Int32 x = parseDump("/root/page/body/tab/row/cell[1]/txt/infos/bounds", "left").toInt32();
+ // Make sure the text does not go outside and verify it is centered roughly
+ CPPUNIT_ASSERT( l + w / 4 < x );
+ CPPUNIT_ASSERT( x < l + 3 * w / 4);
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */