summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-11-07 10:13:08 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-11-07 10:25:56 +0100
commit29cbbad64088354425c606f9eb6c267bdf7731dc (patch)
tree4b3ca6a0e6af96c895b7ba32547ad917b9c985e6 /sw
parent8b8b0dfa1ce9015f0514feaa64234831972a5f1d (diff)
DOCX import: fix rounding error in table cell widths
Change-Id: I733fd4b998ba4d0bde2f91f2b3d76205f0dc8020
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport4.cxx2
-rw-r--r--sw/qa/extras/ooxmlimport/data/tcw-rounding.docxbin0 -> 14876 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx6
3 files changed, 7 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index 3a8502b51e6d..e187959c3013 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -295,7 +295,7 @@ DECLARE_OOXMLEXPORT_TEST(testSegFaultWhileSave, "test_segfault_while_save.docx")
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
if (!pXmlDoc)
return;
- CPPUNIT_ASSERT(getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[2]", "w").match("6138"));
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6137), getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[2]", "w").toInt32());
}
DECLARE_OOXMLEXPORT_TEST(fdo69656, "Table_cell_auto_width_fdo69656.docx")
diff --git a/sw/qa/extras/ooxmlimport/data/tcw-rounding.docx b/sw/qa/extras/ooxmlimport/data/tcw-rounding.docx
new file mode 100644
index 000000000000..d4055c953b6f
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tcw-rounding.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index d4d17663fdec..3a541ad33398 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2391,6 +2391,12 @@ static OString dateTimeToString( const util::DateTime& dt )
return DateTimeToOString( DateTime( Date( dt.Day, dt.Month, dt.Year ), tools::Time( dt.Hours, dt.Minutes, dt.Seconds )));
}
+DECLARE_OOXMLIMPORT_TEST(testTcwRounding, "tcw-rounding.docx")
+{
+ // Width of the A1 cell in twips was 3200, due to a rounding error.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(3201), parseDump("/root/page/body/tab/row/cell[1]/infos/bounds", "width").toInt32());
+}
+
DECLARE_OOXMLIMPORT_TEST(testBnc821804, "bnc821804.docx")
{
CPPUNIT_ASSERT_EQUAL( OUString( "TITLE" ), getRun( getParagraph( 1 ), 1 )->getString());