sw/qa/extras/htmlexport/htmlexport.cxx | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-)
New commits: commit da468c92cfd93c810a79ce7769832367df4ea2b8 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Tue Aug 1 20:14:31 2023 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Wed Aug 2 08:05:32 2023 +0200 CppunitTest_sw_htmlexport: clean up testFdo81276 Still fails with commit 7dff37c65e08985b80ac79e13f5571819a8e739d (fdo#81276: sw: HTML import: fix inverted test in CSS import, 2014-07-22) reverted, but now avoids the almost unused DECLARE_HTMLEXPORT_ROUNDTRIP_TEST macro. Change-Id: I8298606b8521009e733ba1e0ce6e513cd8f3db2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155198 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 8032b9dde026..ab825a735fa7 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -290,17 +290,24 @@ void SwHtmlDomExportTest::ImportFromReqif(const OUString& rUrl) mxComponent = loadFromDesktop(rUrl, "com.sun.star.text.TextDocument", aLoadProperties); } -DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testFdo81276, "fdo81276.html") +CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFdo81276) { - uno::Reference<container::XNameAccess> xPageStyles(getStyles("PageStyles")); - uno::Reference<beans::XPropertySet> xStyle(xPageStyles->getByName("HTML"), uno::UNO_QUERY); - // some rounding going on here? - CPPUNIT_ASSERT(abs(sal_Int32(29700) - getProperty<sal_Int32>(xStyle, "Width")) < 10); - CPPUNIT_ASSERT(abs(sal_Int32(21006) - getProperty<sal_Int32>(xStyle, "Height")) < 10); - CPPUNIT_ASSERT(abs(sal_Int32(500) - getProperty<sal_Int32>(xStyle, "LeftMargin")) < 10); - CPPUNIT_ASSERT(abs(sal_Int32(500) - getProperty<sal_Int32>(xStyle, "RightMargin")) < 10); - CPPUNIT_ASSERT(abs(sal_Int32(2000) - getProperty<sal_Int32>(xStyle, "TopMargin")) < 10); - CPPUNIT_ASSERT(abs(sal_Int32(500) - getProperty<sal_Int32>(xStyle, "BottomMargin")) < 10); + auto verify = [this]() { + uno::Reference<container::XNameAccess> xPageStyles(getStyles("PageStyles")); + uno::Reference<beans::XPropertySet> xStyle(xPageStyles->getByName("HTML"), uno::UNO_QUERY); + // some rounding going on here? + CPPUNIT_ASSERT(abs(sal_Int32(29700) - getProperty<sal_Int32>(xStyle, "Width")) < 10); + CPPUNIT_ASSERT(abs(sal_Int32(21006) - getProperty<sal_Int32>(xStyle, "Height")) < 10); + CPPUNIT_ASSERT(abs(sal_Int32(500) - getProperty<sal_Int32>(xStyle, "LeftMargin")) < 10); + CPPUNIT_ASSERT(abs(sal_Int32(500) - getProperty<sal_Int32>(xStyle, "RightMargin")) < 10); + CPPUNIT_ASSERT(abs(sal_Int32(2000) - getProperty<sal_Int32>(xStyle, "TopMargin")) < 10); + CPPUNIT_ASSERT(abs(sal_Int32(500) - getProperty<sal_Int32>(xStyle, "BottomMargin")) < 10); + }; + setImportFilterName(mpFilter); + createSwDoc("fdo81276.html"); + verify(); + saveAndReload(mpFilter); + verify(); } CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFdo62336)