sw/qa/extras/htmlexport/htmlexport.cxx | 37 ++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 16 deletions(-)
New commits: commit 84e39fb0540aae504beb0e8a3ac29d0e7f6f2426 Author: Miklos Vajna <[email protected]> AuthorDate: Tue Aug 8 20:08:55 2023 +0200 Commit: Miklos Vajna <[email protected]> CommitDate: Wed Aug 9 08:06:50 2023 +0200 CppunitTest_sw_htmlexport: drop single-use DECLARE_HTMLEXPORT_ROUNDTRIP_TEST Which means what the test actually does is now not hidden behind a custom macro. Change-Id: I75d2429dab899ab44f41c9930adbe66f09cacefd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155468 Tested-by: Jenkins Reviewed-by: Miklos Vajna <[email protected]> diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 9cd104f77292..bf6d29e91841 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -206,9 +206,6 @@ public: } }; -#define DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(TestName, filename) \ - DECLARE_SW_ROUNDTRIP_TEST(TestName, filename, nullptr, HtmlExportTest) - /// HTML export of the sw doc model tests. class SwHtmlDomExportTest : public SwModelTestBase, public HtmlTestTools { @@ -319,20 +316,28 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFdo62336) save("HTML (StarWriter)"); } -DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testFdo86857, "fdo86857.html") +CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFdo86857) { - // problem was that background color on page style was not exported - uno::Reference<container::XNameAccess> xPageStyles(getStyles("PageStyles")); - uno::Reference<beans::XPropertySet> xStyle(xPageStyles->getByName("HTML"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, getProperty<Color>(xStyle, "BackColor")); - // check that table background color works, which still uses RES_BACKGROUND - 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> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(Color(0x66ffff), getProperty<Color>(xCell, "BackColor")); + auto verify = [this]() { + // problem was that background color on page style was not exported + uno::Reference<container::XNameAccess> xPageStyles(getStyles("PageStyles")); + uno::Reference<beans::XPropertySet> xStyle(xPageStyles->getByName("HTML"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(COL_LIGHTRED, getProperty<Color>(xStyle, "BackColor")); + // check that table background color works, which still uses RES_BACKGROUND + 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> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(Color(0x66ffff), getProperty<Color>(xCell, "BackColor")); + }; + + setImportFilterName(mpFilter); + createSwDoc("fdo86857.html"); + verify(); + saveAndReload(mpFilter); + verify(); } CPPUNIT_TEST_FIXTURE(HtmlExportTest, testCharacterBorder)
