summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2020-04-28 15:57:42 +0300
committerJustin Luth <justin_luth@sil.org>2020-05-19 21:21:15 +0200
commit76356814075ddc4323f356cf99dcc5a7bbc8f0e4 (patch)
tree0efca8f8554fc654ec43fd897bb3a5a6dd96242a
parenta135eaacd3bf0b6125626e03e73840660bf27bf0 (diff)
tdf#60378 doc import: merged cells - don't null right border
Well, don't null them out at all, for the benefit of merged cells, where the right border might be lost. There doesn't seem to be any point in clearing a border because LO sets a "merge adjacent line styles" in the borders which does exactly what the comment indicated it was trying to do. This option has been around since at least LO 3.5. Change-Id: I22954e5fc31dc1c072f1ff5ccaaa05cd0f69fda4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93064 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> Reviewed-by: Justin Luth <justin_luth@sil.org>
-rw-r--r--sw/qa/extras/ww8export/data/tdf60378_mergedBorders.docbin0 -> 45056 bytes
-rw-r--r--sw/qa/extras/ww8export/ww8export2.cxx11
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx14
3 files changed, 11 insertions, 14 deletions
diff --git a/sw/qa/extras/ww8export/data/tdf60378_mergedBorders.doc b/sw/qa/extras/ww8export/data/tdf60378_mergedBorders.doc
new file mode 100644
index 000000000000..3278f4631018
--- /dev/null
+++ b/sw/qa/extras/ww8export/data/tdf60378_mergedBorders.doc
Binary files differ
diff --git a/sw/qa/extras/ww8export/ww8export2.cxx b/sw/qa/extras/ww8export/ww8export2.cxx
index de6c3354c5f7..46cae102045d 100644
--- a/sw/qa/extras/ww8export/ww8export2.cxx
+++ b/sw/qa/extras/ww8export/ww8export2.cxx
@@ -55,6 +55,17 @@ DECLARE_WW8EXPORT_TEST(testTdf41542_borderlessPadding, "tdf41542_borderlessPaddi
CPPUNIT_ASSERT_EQUAL( 3, getPages() );
}
+DECLARE_WW8EXPORT_TEST(testTdf60378_mergedBorders, "tdf60378_mergedBorders.doc")
+{
+ 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 border width was zero
+ table::BorderLine2 aBorder = getProperty<table::BorderLine2>(xTable->getCellByName("B2"), "RightBorder");
+ CPPUNIT_ASSERT(aBorder.LineWidth > 0);
+}
+
DECLARE_WW8EXPORT_TEST(testTdf55528_relativeTableWidth, "tdf55528_relativeTableWidth.doc")
{
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index cfae69f622be..db9f07ec5ce6 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -3239,21 +3239,7 @@ void WW8TabDesc::AdjustNewBand()
SetTabBorders(pBox, j);
- // #i18128# word has only one line between adjoining vertical cells
- // we have to mimic this in the filter by picking the larger of the
- // sides and using that one on one side of the line (right)
SvxBoxItem aCurrentBox(sw::util::ItemGet<SvxBoxItem>(*(pBox->GetFrameFormat()), RES_BOX));
- if (i != 0)
- {
- SwTableBox* pBox2 = (*m_pTabBoxes)[i-1];
- SvxBoxItem aOldBox(sw::util::ItemGet<SvxBoxItem>(*(pBox2->GetFrameFormat()), RES_BOX));
- if( aOldBox.CalcLineWidth(SvxBoxItemLine::RIGHT) > aCurrentBox.CalcLineWidth(SvxBoxItemLine::LEFT) )
- aCurrentBox.SetLine(aOldBox.GetLine(SvxBoxItemLine::RIGHT), SvxBoxItemLine::LEFT);
-
- aOldBox.SetLine(nullptr, SvxBoxItemLine::RIGHT);
- pBox2->GetFrameFormat()->SetFormatAttr(aOldBox);
- }
-
pBox->GetFrameFormat()->SetFormatAttr(aCurrentBox);
SetTabVertAlign(pBox, j);