summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-02-27 16:36:16 +0600
committerMike Kaganski <mike.kaganski@collabora.com>2024-02-27 15:43:28 +0100
commitd7974d46c8e3d6dc55b3ad11bb6e71e25552cf99 (patch)
tree79514fc1febdc0a2c48efc346509dfe20bfaaeea /sw
parentf34292a105fd1660fbef5f6811ea37ffdfff6c50 (diff)
Simplify a bit
Change-Id: Ib13dab2b57a5ca0d477783887c637d4cabbebcf7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164029 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/htmlexport/htmlexport.cxx34
1 files changed, 10 insertions, 24 deletions
diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx
index 6a2a0f9c1785..fcb60925488c 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -302,7 +302,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFdo62336)
// The problem was essentially a crash during table export as docx/rtf/html
// If calc-layout is enabled, the crash does not occur, that's why loadFromFile/save is used
loadFromFile(u"fdo62336.docx");
- save("HTML (StarWriter)");
+ save(mpFilter);
}
CPPUNIT_TEST_FIXTURE(HtmlExportTest, testFdo86857)
@@ -681,7 +681,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfOleData)
createSwDoc("reqif-ole-data.xhtml");
verify();
setFilterOptions("xhtmlns=reqif-xhtml");
- saveAndReload("HTML (StarWriter)");
+ saveAndReload(mpFilter);
verify();
}
@@ -737,7 +737,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfOleImg)
createSwDoc("reqif-ole-img.xhtml");
verify();
setFilterOptions("xhtmlns=reqif-xhtml");
- saveAndReload("HTML (StarWriter)");
+ saveAndReload(mpFilter);
verify();
}
@@ -1127,8 +1127,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testBlockQuoteReqIf)
xParagraph->setPropertyValue("ParaStyleName", uno::Any(OUString("Quotations")));
// Export it.
- setFilterOptions("xhtmlns=reqif-xhtml");
- save("HTML (StarWriter)");
+ ExportToReqif();
xmlDocUniquePtr pDoc = WrapReqifFromTempFile();
// Without the accompanying fix in place, this test would have failed with:
@@ -1588,9 +1587,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testPartiallyNumberedListHTML)
// When exporting to HTML:
ExportToHTML();
- SvMemoryStream aStream;
- WrapFromTempFile(aStream);
- xmlDocUniquePtr pXmlDoc = parseXmlStream(&aStream);
+ xmlDocUniquePtr pXmlDoc = parseXml(maTempFile);
CPPUNIT_ASSERT(pXmlDoc); // if we have missing closing marks - parse error
// Without the accompanying fix in place, this test would have failed:
@@ -2089,11 +2086,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testOleEmfPreviewToHtml)
createSwDoc("ole2.odt");
// When exporting to HTML:
- uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
- uno::Sequence<beans::PropertyValue> aStoreProperties = {
- comphelper::makePropertyValue("FilterName", OUString("HTML (StarWriter)")),
- };
- xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties);
+ ExportToHTML();
// Then make sure the <img> tag has matching file extension and data:
htmlDocUniquePtr pDoc = parseHtml(maTempFile);
@@ -2275,7 +2268,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testClearingBreak)
createSwWebDoc("clearing-break.html");
// Then make sure that the clear property of the break is not ignored:
verify();
- saveAndReload("HTML (StarWriter)");
+ saveAndReload(mpFilter);
// Make sure that the clear property of the break is not ignored during export:
verify();
}
@@ -2340,11 +2333,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testImageKeepRatio)
xBodyText->insertTextContent(xCursor, xTextContent, false);
// When exporting to HTML:
- uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
- uno::Sequence<beans::PropertyValue> aStoreProperties = {
- comphelper::makePropertyValue("FilterName", OUString("HTML (StarWriter)")),
- };
- xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties);
+ save(mpFilter);
// Then make sure that the width is not a fixed size, that would break on resizing the browser
// window:
@@ -2417,10 +2406,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf114769)
xRun->setPropertyValue("HyperLinkURL", uno::Any(OUString(".\\another.odt")));
// Export
- uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
- uno::Sequence<beans::PropertyValue> aStoreProperties
- = { comphelper::makePropertyValue("FilterName", OUString("HTML (StarWriter)")) };
- xStorable->storeToURL(maTempFile.GetURL(), aStoreProperties);
+ save(mpFilter);
htmlDocUniquePtr pHtmlDoc = parseHtml(maTempFile);
CPPUNIT_ASSERT(pHtmlDoc);
@@ -2440,7 +2426,7 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf114769)
CPPUNIT_TEST_FIXTURE(HtmlExportTest, testTdf153923)
{
createSwDoc("TableWithIndent.fodt");
- save("HTML (StarWriter)");
+ save(mpFilter);
// Parse it as XML (strict!)
xmlDocUniquePtr pDoc = parseXml(maTempFile);