diff options
author | Justin Luth <justin_luth@sil.org> | 2021-10-06 07:38:44 +0200 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2021-10-07 07:21:17 +0200 |
commit | f629dc8dc8b9620508b5bd8e55ddb298438c447f (patch) | |
tree | 681a27d48fe3f59b266f78002824c12617b94dc4 /sw/qa | |
parent | ec76fff198323122bedc63ffdfd896c2543102c6 (diff) |
tdf#143982 doc/x export: save automatic table as 100% relative
Currently, the automatic mode is just being saved as
"determine width from cell size" or absolute size.
But a better match would be 100% of the available space,
so that changing the page or margin size would automatically
increase the table size (which is what automatic implies).
It doesn't appear that MS formats really have a
similar automatic. Their automatic just seems to
say that the width isn't specified at the table level.
So a percent-size seems to be the best match.
RTF currently does not even round-trip relative tables,
so I ignored that format.
Change-Id: I5bfc066864ab630755046b881e98503491cfb1ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123128
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/ww8export/ww8export3.cxx | 11 |
2 files changed, 14 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index 31dba7b98385..b364d1314278 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -1214,6 +1214,10 @@ DECLARE_OOXMLEXPORT_TEST(testTableMarginAdjustment, "table.fodt") assertXPath(pXmlDoc, "//w:tbl[1]/w:tblPr[1]/w:tblInd[1]", "type", "dxa"); assertXPath(pXmlDoc, "//w:tbl[1]/w:tblPr[1]/w:tblInd[1]", "w", "0"); + + + // tdf#143982: automatic tables should export as something better than just left-and-size + CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xTable, "RelativeWidth")); } DECLARE_OOXMLEXPORT_TEST(testTdf119760_tableInTablePosition, "tdf119760_tableInTablePosition.docx") diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx index a0df68658947..01ddaf60016e 100644 --- a/sw/qa/extras/ww8export/ww8export3.cxx +++ b/sw/qa/extras/ww8export/ww8export3.cxx @@ -268,11 +268,20 @@ DECLARE_WW8EXPORT_TEST(testdf79553_lineNumbers, "tdf79553_lineNumbers.doc") CPPUNIT_ASSERT_MESSAGE("automatic distance", nValue > 0); } -DECLARE_WW8EXPORT_TEST(tesTdf138302_restartNumbering, "tdf138302_restartNumbering.odt") +DECLARE_WW8EXPORT_TEST(testTdf138302_restartNumbering, "tdf138302_restartNumbering.odt") { CPPUNIT_ASSERT_EQUAL(1, getPages()); uno::Reference<beans::XPropertySet> xPara(getParagraph(8), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(OUString("1."), getProperty<OUString>(xPara, "ListLabelString")); + + + // tdf#143982: automatic tables should export as something better than just left-and-size + uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + + CPPUNIT_ASSERT(getProperty<bool>(xTable, "IsWidthRelative")); + CPPUNIT_ASSERT_EQUAL(sal_Int16(100), getProperty<sal_Int16>(xTable, "RelativeWidth")); } DECLARE_WW8EXPORT_TEST(testTdf122429_header, "tdf122429_header.doc") |