summaryrefslogtreecommitdiff
path: root/sw/qa/unit/sw-dialogs-test.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/qa/unit/sw-dialogs-test.cxx')
-rw-r--r--sw/qa/unit/sw-dialogs-test.cxx17
1 files changed, 7 insertions, 10 deletions
diff --git a/sw/qa/unit/sw-dialogs-test.cxx b/sw/qa/unit/sw-dialogs-test.cxx
index 48652ca1db74..0e9bd50db309 100644
--- a/sw/qa/unit/sw-dialogs-test.cxx
+++ b/sw/qa/unit/sw-dialogs-test.cxx
@@ -13,6 +13,8 @@
#include <osl/module.hxx>
#include <tools/svlibrary.h>
#include <vcl/abstdlg.hxx>
+#include <comphelper/processfactory.hxx>
+#include <com/sun/star/text/DialogFactoryService.hpp>
class SwAbstractDialogFactory;
@@ -62,16 +64,11 @@ void SwDialogsTest::setUp()
component_ = loadFromDesktop(
"private:factory/swriter", "com.sun.star.text.TextDocument");
// Make sure the swui library's global pSwResMgr is initialized
- // (alternatively to dynamically loading the library, SwCreateDialogFactory
- // could be declared in an include file and this CppunitTest link against
- // the swui library):
- OUString url("${LO_LIB_DIR}/" SVLIBRARY("swui"));
- rtl::Bootstrap::expandMacros(url); //TODO: detect failure
- CPPUNIT_ASSERT(libSwui_.load(url, SAL_LOADMODULE_GLOBAL));
- auto fn = reinterpret_cast<Fn>(
- libSwui_.getFunctionSymbol("SwCreateDialogFactory"));
- CPPUNIT_ASSERT(fn != nullptr);
- (*fn)();
+ auto xService = css::text::DialogFactoryService::create(comphelper::getProcessComponentContext());
+ CPPUNIT_ASSERT(xService.is());
+ // get a factory instance
+ SwAbstractDialogFactory* pFactory = reinterpret_cast<SwAbstractDialogFactory*>(xService->getSomething({}));
+ CPPUNIT_ASSERT(pFactory != nullptr);
}
void SwDialogsTest::tearDown()