[Libreoffice-commits] core.git: sw/qa sw/source

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Tue May 19 19:21:48 UTC 2020


 sw/qa/extras/ww8export/data/tdf60378_mergedBorders.doc |binary
 sw/qa/extras/ww8export/ww8export2.cxx                  |   11 +++++++++++
 sw/source/filter/ww8/ww8par2.cxx                       |   14 --------------
 3 files changed, 11 insertions(+), 14 deletions(-)

New commits:
commit 76356814075ddc4323f356cf99dcc5a7bbc8f0e4
Author:     Justin Luth <justin_luth at sil.org>
AuthorDate: Tue Apr 28 15:57:42 2020 +0300
Commit:     Justin Luth <justin_luth at sil.org>
CommitDate: Tue May 19 21:21:15 2020 +0200

    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 at cib.de>
    Reviewed-by: Justin Luth <justin_luth at sil.org>

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
Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf60378_mergedBorders.doc 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);


More information about the Libreoffice-commits mailing list