summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/data/tcw-rounding.docxbin14876 -> 0 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf123104.docxbin0 -> 24314 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport10.cxx12
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport4.cxx2
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx2
-rw-r--r--sw/qa/extras/rtfexport/rtfexport2.cxx2
-rw-r--r--sw/qa/extras/rtfexport/rtfexport3.cxx4
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx2
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.cxx3
9 files changed, 17 insertions, 10 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tcw-rounding.docx b/sw/qa/extras/ooxmlexport/data/tcw-rounding.docx
deleted file mode 100644
index d4055c953b6f..000000000000
--- a/sw/qa/extras/ooxmlexport/data/tcw-rounding.docx
+++ /dev/null
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf123104.docx b/sw/qa/extras/ooxmlexport/data/tdf123104.docx
new file mode 100644
index 000000000000..73cad8617c7e
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf123104.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
index b3494c754f16..009b77069055 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx
@@ -746,10 +746,16 @@ DECLARE_OOXMLEXPORT_TEST(testBnc891663, "bnc891663.docx")
CPPUNIT_ASSERT( textNextRowTop >= imageTop + imageHeight );
}
-DECLARE_OOXMLEXPORT_TEST(testTcwRounding, "tcw-rounding.docx")
+DECLARE_OOXMLEXPORT_TEST(testTdf123104, "tdf123104.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());
+ uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<table::XCell> xCell = xTable->getCellByName("E1");
+ // See SwXCell::getPropertyValue(), we really put 'long' into an Any there.
+ // Without the accompanying fix in place, this test would have failed with 'Expected: 3;Actual :
+ // 2', i.e. the vertical merge covered one less cell, resulting in a cell with white background.
+ CPPUNIT_ASSERT_EQUAL(static_cast<long>(3), getProperty<long>(xCell, "RowSpan"));
}
DECLARE_OOXMLEXPORT_TEST(testFdo85542, "fdo85542.docx")
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
index beaa1b936cc4..70fb4a16a73e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx
@@ -298,7 +298,7 @@ DECLARE_OOXMLEXPORT_TEST(testSegFaultWhileSave, "test_segfault_while_save.docx")
xmlDocPtr pXmlDoc = parseExport("word/document.xml");
if (!pXmlDoc)
return;
- CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6137), getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[2]", "w").toInt32());
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(6138), getXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tblGrid/w:gridCol[2]", "w").toInt32());
// tdf#106572 - preventative test matching danger conditions, but imported OK anyway
CPPUNIT_ASSERT_EQUAL(OUString("First Page"), getProperty<OUString>(getParagraphOrTable(1), "PageDescName"));
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 7dd8d79ced50..b42e855aa616 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -1419,7 +1419,7 @@ DECLARE_RTFEXPORT_TEST(testTdf112507, "tdf112507.rtf")
// First table's second row had 3 cells (so 2 separators).
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), aSeparators.getLength());
// This was 3333, i.e. the B2 cell was too narrow and the text needed 2 lines.
- CPPUNIT_ASSERT_GREATER(5000, aSeparators[1].Position - aSeparators[0].Position);
+ CPPUNIT_ASSERT_GREATEREQUAL(5000, aSeparators[1].Position - aSeparators[0].Position);
}
DECLARE_RTFEXPORT_TEST(testTdf107480, "tdf107480.rtf")
diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx
index e5b2fd4f958b..307b6465ecad 100644
--- a/sw/qa/extras/rtfexport/rtfexport2.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport2.cxx
@@ -1831,7 +1831,7 @@ DECLARE_RTFEXPORT_TEST(testTdf97035, "tdf97035.rtf")
// First cell width of the second row should be 2300
uno::Reference<table::XTableRows> xTableRows(xTable->getRows(), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(2300), getProperty<uno::Sequence<text::TableColumnSeparator>>(
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(2299), getProperty<uno::Sequence<text::TableColumnSeparator>>(
xTableRows->getByIndex(1), "TableColumnSeparators")[0]
.Position);
}
diff --git a/sw/qa/extras/rtfexport/rtfexport3.cxx b/sw/qa/extras/rtfexport/rtfexport3.cxx
index 576f7b6c85b8..85dbb38413ba 100644
--- a/sw/qa/extras/rtfexport/rtfexport3.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport3.cxx
@@ -124,10 +124,10 @@ DECLARE_RTFEXPORT_TEST(testTdf115180, "tdf115180.docx")
CPPUNIT_ASSERT_EQUAL_MESSAGE("Row width", sal_Int32(9360), rowWidth);
sal_Int32 cell1Width
= parseDump("/root/page/body/tab/row/cell[1]/infos/bounds", "width").toInt32();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("First cell width", sal_Int32(9142), cell1Width);
+ CPPUNIT_ASSERT_MESSAGE("First cell width", cell1Width >= 9140 && cell1Width <= 9142);
sal_Int32 cell2Width
= parseDump("/root/page/body/tab/row/cell[2]/infos/bounds", "width").toInt32();
- CPPUNIT_ASSERT_EQUAL_MESSAGE("First cell width", sal_Int32(218), cell2Width);
+ CPPUNIT_ASSERT_MESSAGE("Second cell width", cell2Width >= 218 && cell2Width <= 220);
}
DECLARE_RTFEXPORT_TEST(testTdf116841, "tdf116841.rtf")
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index f09169ed77d3..5d7e6f34db79 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -460,7 +460,7 @@ DECLARE_RTFIMPORT_TEST(testFdo55525, "fdo55525.rtf")
CPPUNIT_ASSERT_EQUAL(sal_Int32(-1877), getProperty<sal_Int32>(xTable, "LeftMargin"));
// Cell width of A1 was 3332 (e.g. not set, 30% percent of total width)
uno::Reference<table::XTableRows> xTableRows(xTable->getRows(), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(897), getProperty<uno::Sequence<text::TableColumnSeparator>>(
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(896), getProperty<uno::Sequence<text::TableColumnSeparator>>(
xTableRows->getByIndex(0), "TableColumnSeparators")[0]
.Position);
}
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index b1b08b72c8d2..b698fabe0c44 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -679,7 +679,8 @@ void DomainMapperTableManager::endOfRowAction()
for ( sal_Int32 nGridCount = *aSpansIter; nGridCount > 0; --nGridCount )
fGridWidth += (*pTableGrid.get())[nBorderGridIndex++];
- sal_Int16 nRelPos = rtl::math::round((fGridWidth * 10000) / nFullWidthRelative);
+ sal_Int16 nRelPos =
+ sal::static_int_cast< sal_Int16 >((fGridWidth * 10000) / nFullWidthRelative);
pSeparators[nBorder].Position = nRelPos + nLastRelPos;
pSeparators[nBorder].IsVisible = true;