summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-06-29 16:47:24 +0300
committerJustin Luth <justin_luth@sil.org>2020-07-13 20:51:28 +0200
commit19d7f9624e92422409ed2744091d502fdae8692b (patch)
treeb04e5abf6024bb4b181212a75d186ebd787841c0 /sw
parent9ad54d31c80a6ba826f3c121efbf6b9376140c86 (diff)
tdf#129452 writerfilter: use column, not cell when comparing rows
A natural mistake - especially when there are no existing functions - is to assume that cell number defines column number, and so it is valid to compare between rows. This patch provides the functions, and switches this bug's earlier patch to properly use columns instead of cells. This commit depends on two prior patches in bug 129452: Change-Id: Ie305477f0e3468a4a923095d76f520d97fe99ffe Change-Id: Ibfdac336bbb1f7303c7e585a85c94be37ad6f916 I hope that this implementation covers all the bases. This code is dreadful to understand, as witnessed by comments from those much smarter than I. P.S. I also cancelled a vertical merge if the cell is not there (in a gridAfter situation). If a row is shorter than the previous ones, then a vertically merged cell should not be considered to be able to span that gap. If the cells below are still merged, it would be considered a new merged cell. Change-Id: I63158ac73b1bf86d9f75dd3c1299d1b1a3f08064 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97434 Tested-by: Justin Luth <justin_luth@sil.org> Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf129452_excessBorder.docxbin0 -> 11115 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport15.cxx11
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf129452_excessBorder.docx b/sw/qa/extras/ooxmlexport/data/tdf129452_excessBorder.docx
new file mode 100644
index 000000000000..2bce3ff883bc
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf129452_excessBorder.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 27e2f22c2dbc..1e13de385fa4 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -45,6 +45,17 @@ DECLARE_OOXMLEXPORT_TEST(testTdf133370_columnBreak, "tdf133370_columnBreak.odt")
CPPUNIT_ASSERT_EQUAL(1, getPages());
}
+DECLARE_OOXMLEXPORT_TEST(testTdf129452_excessBorder, "tdf129452_excessBorder.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_THROW);
+
+ // The outside border should not be applied on inside cells. The merge doesn't extend to the table bottom.
+ // [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);
+}
DECLARE_OOXMLEXPORT_TEST(testTdf134063, "tdf134063.docx")
{