diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-07-07 20:02:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-07 22:13:02 +0200 |
commit | 71227e2306987cb8aa5fbda2943e73237674e9ba (patch) | |
tree | 9491ef57b3b1192e0f35b69bc8c368d42624ad31 /framework/source/services | |
parent | 9ff8a1173a72b9ebea54ef3b00b1d632bf953e37 (diff) |
framework: create instances with uno constructors
See tdf#74608 for motivation
Change-Id: I8679b50395d11cb2d807d52526d803df9b0606b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98294
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework/source/services')
-rw-r--r-- | framework/source/services/dispatchhelper.cxx | 24 | ||||
-rw-r--r-- | framework/source/services/uriabbreviation.cxx | 31 |
2 files changed, 41 insertions, 14 deletions
diff --git a/framework/source/services/dispatchhelper.cxx b/framework/source/services/dispatchhelper.cxx index 2a28d9cebdae..b0c6e7e9b4a5 100644 --- a/framework/source/services/dispatchhelper.cxx +++ b/framework/source/services/dispatchhelper.cxx @@ -33,11 +33,20 @@ namespace framework { // XInterface, XTypeProvider, XServiceInfo -DEFINE_XSERVICEINFO_MULTISERVICE_2(DispatchHelper, ::cppu::OWeakObject, - "com.sun.star.frame.DispatchHelper", - IMPLEMENTATIONNAME_DISPATCHHELPER) +OUString SAL_CALL DispatchHelper::getImplementationName() +{ + return "com.sun.star.comp.framework.services.DispatchHelper"; +} + +sal_Bool SAL_CALL DispatchHelper::supportsService(const OUString& sServiceName) +{ + return cppu::supportsService(this, sServiceName); +} -DEFINE_INIT_SERVICE(DispatchHelper, {}) +css::uno::Sequence<OUString> SAL_CALL DispatchHelper::getSupportedServiceNames() +{ + return { "com.sun.star.frame.DispatchHelper" }; +} /** ctor. @@ -192,4 +201,11 @@ void SAL_CALL DispatchHelper::disposing(const css::lang::EventObject&) } } +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +framework_DispatchHelper_get_implementation(css::uno::XComponentContext* context, + css::uno::Sequence<css::uno::Any> const&) +{ + return cppu::acquire(new framework::DispatchHelper(context)); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/source/services/uriabbreviation.cxx b/framework/source/services/uriabbreviation.cxx index 6762afcf0f61..ae27f5a9e1c4 100644 --- a/framework/source/services/uriabbreviation.cxx +++ b/framework/source/services/uriabbreviation.cxx @@ -28,18 +28,22 @@ namespace framework { -// XInterface, XTypeProvider, XServiceInfo +// XInterface, XTypeProvider, XServiceInfo -DEFINE_XSERVICEINFO_MULTISERVICE_2 ( UriAbbreviation , - ::cppu::OWeakObject , - SERVICENAME_STRINGABBREVIATION , - IMPLEMENTATIONNAME_URIABBREVIATION - ) +OUString SAL_CALL UriAbbreviation::getImplementationName() +{ + return "com.sun.star.comp.framework.UriAbbreviation"; +} + +sal_Bool SAL_CALL UriAbbreviation::supportsService( const OUString& sServiceName ) +{ + return cppu::supportsService(this, sServiceName); +} -DEFINE_INIT_SERVICE ( UriAbbreviation, - { - } - ) +css::uno::Sequence< OUString > SAL_CALL UriAbbreviation::getSupportedServiceNames() +{ + return { SERVICENAME_STRINGABBREVIATION }; +} UriAbbreviation::UriAbbreviation(css::uno::Reference< css::uno::XComponentContext > const & ) { @@ -61,4 +65,11 @@ OUString SAL_CALL UriAbbreviation::abbreviateString(const css::uno::Reference< c } // namespace framework +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +framework_UriAbbreviation_get_implementation( + css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& ) +{ + return cppu::acquire(new framework::UriAbbreviation(context)); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |