[Libreoffice-commits] core.git: sw/qa

Mark Hung marklh9 at gmail.com
Sat Dec 24 02:35:41 UTC 2016


 sw/qa/extras/odfimport/data/tdf101729.odt |binary
 sw/qa/extras/odfimport/odfimport.cxx      |   10 ++++++++++
 2 files changed, 10 insertions(+)

New commits:
commit f05714c3527635bd78bf7ded7b7a160dbe3b4685
Author: Mark Hung <marklh9 at gmail.com>
Date:   Mon Dec 12 01:12:21 2016 +0800

    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 at libreoffice.org>
    Reviewed-by: Mark Hung <marklh9 at gmail.com>

diff --git a/sw/qa/extras/odfimport/data/tdf101729.odt b/sw/qa/extras/odfimport/data/tdf101729.odt
new file mode 100755
index 0000000..3afd2d0
Binary files /dev/null and b/sw/qa/extras/odfimport/data/tdf101729.odt differ
diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx
index 9c21cad..1500ff8 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: */


More information about the Libreoffice-commits mailing list