sw/qa/extras/htmlexport/htmlexport.cxx |   23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

New commits:
commit ecb76e447891fb35c599abf36415952ea700561f
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Tue Apr 18 20:11:21 2023 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Wed Apr 19 08:16:03 2023 +0200

    CppunitTest_sw_htmlexport: avoid reqif magic in testReqIfOleData
    
    Set the filter options explicitly, rather than inferring it from the
    test name.
    
    Change-Id: I96ab2055c154ebd464b930fc4c6808ffbc12bda0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150585
    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 de65983ac2ab..8ec0c1bd6fc1 100644
--- a/sw/qa/extras/htmlexport/htmlexport.cxx
+++ b/sw/qa/extras/htmlexport/htmlexport.cxx
@@ -695,14 +695,23 @@ CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfParagraph)
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), 
aStream.indexOf("<reqif-xhtml:a id="));
 }
 
-DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testReqIfOleData, "reqif-ole-data.xhtml")
+CPPUNIT_TEST_FIXTURE(HtmlExportTest, testReqIfOleData)
 {
-    uno::Reference<text::XTextEmbeddedObjectsSupplier> xSupplier(mxComponent, 
uno::UNO_QUERY);
-    uno::Reference<container::XIndexAccess> 
xObjects(xSupplier->getEmbeddedObjects(),
-                                                     uno::UNO_QUERY);
-    // This was 0, <object> without URL was ignored.
-    // Then this was 0 on export, as data of OLE nodes was ignored.
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xObjects->getCount());
+    auto verify = [this]() {
+        uno::Reference<text::XTextEmbeddedObjectsSupplier> 
xSupplier(mxComponent, uno::UNO_QUERY);
+        uno::Reference<container::XIndexAccess> 
xObjects(xSupplier->getEmbeddedObjects(),
+                                                         uno::UNO_QUERY);
+        // This was 0, <object> without URL was ignored.
+        // Then this was 0 on export, as data of OLE nodes was ignored.
+        CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xObjects->getCount());
+    };
+    setImportFilterOptions("xhtmlns=reqif-xhtml");
+    setImportFilterName("HTML (StarWriter)");
+    createSwDoc("reqif-ole-data.xhtml");
+    verify();
+    setFilterOptions("xhtmlns=reqif-xhtml");
+    reload(mpFilter, "reqif-ole-data.xhtml");
+    verify();
 }
 
 DECLARE_HTMLEXPORT_ROUNDTRIP_TEST(testReqIfOleImg, "reqif-ole-img.xhtml")

Reply via email to