summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ww8export
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-04-21 14:25:38 +0300
committerMiklos Vajna <vmiklos@collabora.com>2020-04-29 12:01:21 +0200
commit623d6cf06ccba392c1993a3b0ad271d508205e73 (patch)
treee29a1c700addb897f290364aa82f7608f91e9780 /sw/qa/extras/ww8export
parent6cd1591fb8b0a550067c37cf720708c6a5630b6d (diff)
tdf#73056 doc import: table margins - unknown byte is EndCell
The problem was that the cell margin that overrides the table defaults was only being applied to one cell, while a range of cells might be defined. a sprmTCellPadding is specified by a CSSA. The CSSA starts with an ItcFirstLim, which consists of a start and end cell. The end cell is NOT included. Change-Id: Ia90bc28451d39d60ce343d24b02fd3661b05d950 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92628 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/qa/extras/ww8export')
-rw-r--r--sw/qa/extras/ww8export/data/tdf73056_cellMargins.docbin0 -> 25088 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx13
2 files changed, 13 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf73056_cellMargins.doc b/sw/qa/extras/ww8export/data/tdf73056_cellMargins.doc
new file mode 100644
index 000000000000..7ae12d452e94
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf73056_cellMargins.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index 87bc1787e991..b447c7fd3225 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -179,6 +179,19 @@ DECLARE_WW8EXPORT_TEST(testFdo53985, "fdo53985.doc")
CPPUNIT_ASSERT_EQUAL_MESSAGE("Section4 is protected", false, getProperty<bool>(xSect, "IsProtected"));
}
+DECLARE_WW8EXPORT_TEST(testTdf73056_cellMargins, "tdf73056_cellMargins.doc")
+{
+ uno::Reference< text::XTextTablesSupplier > xTablesSupplier( mxComponent, uno::UNO_QUERY );
+ uno::Reference< container::XIndexAccess > xTables( xTablesSupplier->getTextTables(), uno::UNO_QUERY );
+ uno::Reference< text::XTextTable > xTable1( xTables->getByIndex( 0 ), uno::UNO_QUERY );
+ uno::Reference< table::XCell > xCell = xTable1->getCellByName( "B4" );
+
+ // only the first cell with specific margins was processed, leaving the rest at table defaults. Was 0.
+ uno::Reference< beans::XPropertySet > xPropSet( xCell, uno::UNO_QUERY_THROW );
+ if ( !mbExported )
+ CPPUNIT_ASSERT_EQUAL_MESSAGE( "bottom cell spacing to contents",
+ sal_Int32(101), getProperty<sal_Int32>(xPropSet, "BottomBorderDistance" ) );
+}
DECLARE_WW8EXPORT_TEST(testTdf79435_legacyInputFields, "tdf79435_legacyInputFields.docx")
{
//using .docx input file to verify cross-format compatibility.