summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ww8export
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-07-15 17:07:46 +0300
committerMiklos Vajna <vmiklos@collabora.com>2020-07-20 16:01:47 +0200
commit565912fa0334de1c05749768796a33a1a5e6b984 (patch)
tree51dde5ba89561ffcc678b1ab56f27420f3bfd484 /sw/qa/extras/ww8export
parent39e25b9cd45c4d658dac36bc1f08e0480b32c9d7 (diff)
tdf#117217 ww8: export/import all cell backgrounds
... using TDefTableShd2nd and TDefTableShd3rd P.S. There might be some other subtleties going on here. > sprmTDefTableShdRaw: > If a cell is set to ShdAuto in rgShd, the cell is > not shaded. If a cell is set to ShdNil in rgShd, the cell is shaded > according to the table style. By default, cells are shaded according > to the table style. (sprmTDefTableShdRaw not imported in LO, and ShdNil unknown) > sprmTDefTableShd: > If nFib is greater than 0x00D9 and the application understands > table styles, then this Sprm MUST be ignored. (aka NewShd from MSO 2000ish - never ignored by LO, and almost certainly LO doesn't understand these table styles despite ?nFib == 0x0101? ) These seem to be very "late" modifications to the .doc format, so likely very few things support the advanced features. In any case, I haven't done anything novel here - just copying what was done for template1 into template2 and template3, so these subtleties are irrelevant for this patch. Change-Id: Ic330179cf771a6f2531ed75dfb441fba10a04c7c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98856 Tested-by: Justin Luth <justin_luth@sil.org> 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/tdf117217_largeTableBackgrounds.odtbin0 -> 10988 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export3.cxx12
2 files changed, 12 insertions, 0 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf117217_largeTableBackgrounds.odt b/sw/qa/extras/ww8export/data/tdf117217_largeTableBackgrounds.odt
new file mode 100644
index 000000000000..bbb1eaab3c8c
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf117217_largeTableBackgrounds.odt
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index 13da2fec9d1b..460937c08895 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -417,6 +417,18 @@ DECLARE_WW8EXPORT_TEST(testTdf128608_tableParaBackColor, "tdf128608_tableParaBac
CPPUNIT_ASSERT_EQUAL_MESSAGE("No fillstyle", drawing::FillStyle_NONE, getProperty<drawing::FillStyle>(xPara, "FillStyle"));
}
+DECLARE_WW8EXPORT_TEST(testTdf117217_largeTableBackgrounds, "tdf117217_largeTableBackgrounds.odt")
+{
+ 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);
+ // Cell 22: light-red == 16711680
+ uno::Reference<text::XTextRange> xCell(xTable->getCellByName("V1"), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("light red", sal_Int32(0xE0C2CD), getProperty<sal_Int32>(xCell, "BackColor"));
+ xCell.set(xTable->getCellByName("Z1"), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("light red", sal_Int32(0xE0C2CD), getProperty<sal_Int32>(xCell, "BackColor"));
+}
+
DECLARE_WW8EXPORT_TEST(testTdf94009_zeroPgMargin, "tdf94009_zeroPgMargin.odt")
{
CPPUNIT_ASSERT_EQUAL(1, getPages());