diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-02-21 11:30:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-02-29 14:41:48 +0100 |
commit | 1af510e95147374e5289ae1c12f1f280931919f4 (patch) | |
tree | f5e2ec39ede2571690c78d7a7ef6fa9d41369fdf /toolkit | |
parent | b1f84f5479a8ed06d07d4eef6b83578789fd67f0 (diff) |
Create an UNO service to do the symbol lookup in toolkit::AccessibilityClient
which means I can remove one usage of gb_Library_set_plugin_for, which is blocking linking the accessibility module into --enable-mergelibs=more
Change-Id: I8664ae1d2da4526cc7eab79b36e1589eb391d7c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163680
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/helper/accessibilityclient.cxx | 37 |
1 files changed, 6 insertions, 31 deletions
diff --git a/toolkit/source/helper/accessibilityclient.cxx b/toolkit/source/helper/accessibilityclient.cxx index c8bbf2cfb523..01c0cd6b920f 100644 --- a/toolkit/source/helper/accessibilityclient.cxx +++ b/toolkit/source/helper/accessibilityclient.cxx @@ -23,13 +23,14 @@ #include <sal/config.h> #include <toolkit/helper/accessiblefactory.hxx> -#include <osl/module.h> +#include <comphelper/processfactory.hxx> #include <osl/diagnose.h> #include <osl/mutex.hxx> #include <rtl/ref.hxx> #include <tools/svlibrary.h> #include <helper/accessibilityclient.hxx> +#include <com/sun/star/accessibility/GetStandardAccessibleFactoryService.hpp> namespace toolkit { @@ -38,14 +39,6 @@ namespace toolkit namespace { -#ifndef DISABLE_DYNLOADING - oslModule s_hAccessibleImplementationModule = nullptr; -#endif -#if HAVE_FEATURE_DESKTOP -#if !ENABLE_WASM_STRIP_ACCESSIBILITY - GetStandardAccComponentFactory s_pAccessibleFactoryFunc = nullptr; -#endif -#endif ::rtl::Reference< IAccessibleFactory > s_pFactory; } @@ -58,16 +51,6 @@ namespace toolkit { } -#if !ENABLE_WASM_STRIP_ACCESSIBILITY -#if HAVE_FEATURE_DESKTOP -#ifndef DISABLE_DYNLOADING - extern "C" { static void thisModule() {} } -#else - extern "C" void *getStandardAccessibleFactory(); -#endif -#endif // HAVE_FEATURE_DESKTOP -#endif // ENABLE_WASM_STRIP_ACCESSIBILITY - void AccessibilityClient::ensureInitialized() { if ( m_bInitialized ) @@ -77,20 +60,12 @@ namespace toolkit #if !ENABLE_WASM_STRIP_ACCESSIBILITY #if HAVE_FEATURE_DESKTOP - // load the library implementing the factory if (!s_pFactory) { -#ifndef DISABLE_DYNLOADING - s_hAccessibleImplementationModule = osl_loadModuleRelative( &thisModule, u"" SVLIBRARY( "acc" ) ""_ustr.pData, 0 ); - assert(s_hAccessibleImplementationModule); - s_pAccessibleFactoryFunc = reinterpret_cast<GetStandardAccComponentFactory>( - osl_getFunctionSymbol( s_hAccessibleImplementationModule, u"getStandardAccessibleFactory"_ustr.pData )); -#else - s_pAccessibleFactoryFunc = getStandardAccessibleFactory; -#endif // DISABLE_DYNLOADING - - assert(s_pAccessibleFactoryFunc); - IAccessibleFactory* pFactory = static_cast< IAccessibleFactory* >( (*s_pAccessibleFactoryFunc)() ); + auto xService = css::accessibility::GetStandardAccessibleFactoryService::create(comphelper::getProcessComponentContext()); + assert(xService); + // get a factory instance + IAccessibleFactory* pFactory = reinterpret_cast<IAccessibleFactory*>(xService->getSomething({})); assert(pFactory); s_pFactory = pFactory; pFactory->release(); |