summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-06-04 18:46:23 +0300
committerJustin Luth <justin_luth@sil.org>2020-07-16 18:42:29 +0200
commit03803de58bd426eb0b726437dc205d92383e8e2e (patch)
tree48982f42592c45d2e94a5ca0225c49c336ce4447 /sw
parent56b04e40ab72b6333ce278ba2980650f5272025f (diff)
tdf#132898 writerfilter: use last merged cell's bottom border
Previously, this was just using the border set on the first cell. Obviously, the bottom merged cell should contain the definitive setting for the bottom border. This depends on all of the commits for tdf#129452. P.S. The top border is obviously fine defined by the top merged cell. P.S. The left/right borders are a bit more interesting. In MSO, each row's value applies to that section of the merged cell. I.E., it isn't treated as a cell border at all. Only noted as a comment here, since how to deal with it is probably best left as is - defined by the top cell. Change-Id: Ibe8d31cba5122078ce73020f7816bff0b2ae36c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95528 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw')
-rwxr-xr-xsw/qa/extras/ooxmlexport/data/tdf132898_extraBorder.docxbin0 -> 11252 bytes
-rwxr-xr-xsw/qa/extras/ooxmlexport/data/tdf132898_missingBorder.docxbin0 -> 25304 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport15.cxx29
3 files changed, 29 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf132898_extraBorder.docx b/sw/qa/extras/ooxmlexport/data/tdf132898_extraBorder.docx
new file mode 100755
index 000000000000..50ebe7a29770
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf132898_extraBorder.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/data/tdf132898_missingBorder.docx b/sw/qa/extras/ooxmlexport/data/tdf132898_missingBorder.docx
new file mode 100755
index 000000000000..54856dea554a
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf132898_missingBorder.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index f3d2df38cb3d..26c36ff9eecf 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -80,6 +80,35 @@ DECLARE_OOXMLEXPORT_TEST(testTdf129452_excessBorder, "tdf129452_excessBorder.doc
// [Note: as humans, we would call this cell D3, but since row 4 hasn't been analyzed yet, it is considered column C.]
table::BorderLine2 aBorder = getProperty<table::BorderLine2>(xTable->getCellByName("C3"), "BottomBorder");
CPPUNIT_ASSERT_EQUAL_MESSAGE("No bottom border on merged cell", sal_uInt32(0), aBorder.LineWidth);
+
+ // [Note: as humans, we would call this cell C3, but since row 4 hasn't been analyzed yet, it is considered column B.]
+ aBorder = getProperty<table::BorderLine2>(xTable->getCellByName("B3"), "BottomBorder");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("No bottom border on merged cell", sal_uInt32(0), aBorder.LineWidth);
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf132898_missingBorder, "tdf132898_missingBorder.docx")
+{
+ 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);
+
+ // The bottom border from the last merged cell was not showing
+ table::BorderLine2 aBorder = getProperty<table::BorderLine2>(xTable->getCellByName("A1"), "BottomBorder");
+ CPPUNIT_ASSERT_MESSAGE("Bottom border on merged cell", aBorder.LineWidth > 0);
+}
+
+DECLARE_OOXMLEXPORT_TEST(testTdf132898_extraBorder, "tdf132898_extraBorder.docx")
+{
+ 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);
+
+ // A border defined on an earlier merged cell was showing
+ table::BorderLine2 aBorder = getProperty<table::BorderLine2>(xTable->getCellByName("C1"), "BottomBorder");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("No bottom border on merged cell", sal_uInt32(0), aBorder.LineWidth);
+ // MS Word is interesting here. 2/3 of the merged cell has the right border, so what to do?
+ aBorder = getProperty<table::BorderLine2>(xTable->getCellByName("C1"), "RightBorder");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("No right border on merged cell", sal_uInt32(0), aBorder.LineWidth);
}
DECLARE_OOXMLEXPORT_TEST(testTdf131561_necessaryBorder, "tdf131561_necessaryBorder.docx")