diff options
author | Vasily Melenchuk <Vasily.Melenchuk@cib.de> | 2017-06-06 15:35:17 +0300 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-06-08 03:39:34 +0200 |
commit | 74d9b711d71cbaf4f853559211f6525db4a4b5db (patch) | |
tree | 097374d8b7f2df87a28b84bae76e309ba554c58a /sw/qa | |
parent | cb444c17ca2834e53a9c5c797bae765f08e40101 (diff) |
html import: kill ancient hack screwing up vertical table borders
HTML tables with border="1" were parsed and displayed incorrectly:
no vertical borders; invalid border width.
Also fixing problem with strange condition allowing setting right
border.
Change-Id: Ibe87e630ef9ef0a4352bbe659340f69c8ebc0d0d
Reviewed-on: https://gerrit.libreoffice.org/38454
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/htmlimport/data/table_border_1px.html | 22 | ||||
-rw-r--r-- | sw/qa/extras/htmlimport/htmlimport.cxx | 32 |
2 files changed, 54 insertions, 0 deletions
diff --git a/sw/qa/extras/htmlimport/data/table_border_1px.html b/sw/qa/extras/htmlimport/data/table_border_1px.html new file mode 100644 index 000000000000..6181aa0f82f2 --- /dev/null +++ b/sw/qa/extras/htmlimport/data/table_border_1px.html @@ -0,0 +1,22 @@ +<table border="1"> +<tr> +<td>Schlüssel</td> +<td>Name_des_Tests</td> +<td>3</td> +</tr> +<tr> +<td>Öffnen der "Document Type" Maske</td> +<td>AF01.01</td> +<td>3</td> +</tr> +<tr> +<td>Öffnen der "Document Type" Maske</td> +<td>Öffnen der "Document Type" Maske</td> +<td>3</td> +</tr> +<tr> +<td>Öffnen der "Document Type" Maske</td> +<td>Öffnen der "Document Type" Maske</td> +<td>3</td> +</tr> +</table>
\ No newline at end of file diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx index ebc665fcdd55..19f51c1824ea 100644 --- a/sw/qa/extras/htmlimport/htmlimport.cxx +++ b/sw/qa/extras/htmlimport/htmlimport.cxx @@ -221,6 +221,38 @@ DECLARE_HTMLIMPORT_TEST(testChangedby, "meta-changedby.html") CPPUNIT_ASSERT(!xFields->hasMoreElements()); } +DECLARE_HTMLIMPORT_TEST(testTableBorder1px, "table_border_1px.html") +{ + uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTables->getCount()); + uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); + + uno::Reference<text::XTextRange> xCellA1(xTable->getCellByName("A1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,9,9,9,3,26), getProperty<table::BorderLine2>(xCellA1,"TopBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,0,2,4,3,2), getProperty<table::BorderLine2>(xCellA1,"BottomBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,9,9,9,3,26), getProperty<table::BorderLine2>(xCellA1,"LeftBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,9,9,9,3,26), getProperty<table::BorderLine2>(xCellA1,"RightBorder")); + + uno::Reference<text::XTextRange> xCellB1(xTable->getCellByName("B1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,9,9,9,3,26), getProperty<table::BorderLine2>(xCellB1,"TopBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,0,2,4,3,2), getProperty<table::BorderLine2>(xCellB1,"BottomBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,0,2,4,3,2), getProperty<table::BorderLine2>(xCellB1,"LeftBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,9,9,9,3,26), getProperty<table::BorderLine2>(xCellB1,"RightBorder")); + + uno::Reference<text::XTextRange> xCellA2(xTable->getCellByName("A2"), uno::UNO_QUERY); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x0,0,0,0,0,0), getProperty<table::BorderLine2>(xCellA2,"TopBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,0,2,4,3,2), getProperty<table::BorderLine2>(xCellA2,"BottomBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,9,9,9,3,26), getProperty<table::BorderLine2>(xCellA2,"LeftBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,9,9,9,3,26), getProperty<table::BorderLine2>(xCellA2,"RightBorder")); + + uno::Reference<text::XTextRange> xCellB2(xTable->getCellByName("B2"), uno::UNO_QUERY); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x0,0,0,0,0,0), getProperty<table::BorderLine2>(xCellB2,"TopBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,0,2,4,3,2), getProperty<table::BorderLine2>(xCellB2,"BottomBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,0,2,4,3,2), getProperty<table::BorderLine2>(xCellB2,"LeftBorder")); + CPPUNIT_ASSERT_BORDER_EQUAL(table::BorderLine2(0x808080,9,9,9,3,26), getProperty<table::BorderLine2>(xCellB2,"RightBorder")); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |