diff options
author | Justin Luth <justin_luth@sil.org> | 2018-09-26 10:23:20 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2018-09-29 07:16:34 +0200 |
commit | 5d4c6ee89ef6302db08c23bbe2d3fb4d7de3b1a3 (patch) | |
tree | f7e4834b2a6d724d012d72c6630d5372dd3c3970 /sw/qa | |
parent | 79761d6b64d31efdac61172ec4d9bf71197e462e (diff) |
tdf#92026 docxexport: eliminate fake tblBorders
This patch depends on tdf#119760.
The border was based on whatever cell A1 had, but that fake
default was never passed to the cell's functions, so the
table border definition served no purpose whatsoever.
Cells had no idea whether they needed to override those
default borders, and this was bad for non-borders, because
then the default borders were assigned instead of none.
The other option would be to properly fill m_aTableStyleConf,
but that didn't seem valuable. Better, and less code churn,
to just eliminate the function altogether. (Well, the
empty function kept in place as a placeholder for
someone who decides it could be useful to reduce
the number of borders written out per cell.)
Unit test fdo80097.docx's fix was just trying to
prevent an invalid table border. Since that is still
obviously true when no table border is defined,
it is valid to just eliminate this part of the test.
(Having a table definition wouldn't be invalid
in the future, so I'm not testing for zero instances.)
Change-Id: I983dbe120bfc3354fefd14bc95ac01abccea7ea8
Reviewed-on: https://gerrit.libreoffice.org/60989
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 5 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 11 |
2 files changed, 4 insertions, 12 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index 933bd58b1071..db52d019439b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -532,7 +532,10 @@ DECLARE_OOXMLEXPORT_TEST(testTdf82177_tblBorders, "tdf82177_tblBorders.docx") uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); uno::Reference< text::XTextTable > xTable( xTables->getByIndex(0), uno::UNO_QUERY ); - uno::Reference< table::XCell > xCell = xTable->getCellByName( "E5" ); + uno::Reference< table::XCell > xCell = xTable->getCellByName( "A5" ); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(xCell, "BottomBorder").LineWidth); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(xCell, "LeftBorder").LineWidth); + xCell.set(xTable->getCellByName( "E5" )); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(xCell, "TopBorder").LineWidth); CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(0), getProperty<table::BorderLine2>(xCell, "LeftBorder").LineWidth); } diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 858f20d0e3b9..401af06a6533 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -669,17 +669,6 @@ DECLARE_OOXMLEXPORT_TEST(testfdo80097, "fdo80097.docx") if (!pXmlDocument) return; - //Table Borders - assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:top[@w:val = 'single']",1); - assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:top[@w:sz = 4]", 1); - assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:top[@w:space = 0]", 1); - assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:top[@w:color = '000000']", 1); - - assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:bottom[@w:val = 'single']",1); - assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:bottom[@w:sz = 4]", 1); - assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:bottom[@w:space = 0]", 1); - assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:bottom[@w:color = '000000']", 1); - //Table Cell Borders assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:val = 'single']",1); assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:sz = 4]", 1); |