diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-07-09 20:05:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-07-11 11:34:08 +0200 |
commit | cb444989d31ba7c709474f1c2f072d924564d10f (patch) | |
tree | fa47acfa0762da56e8522c6f09ba5416817636e8 /desktop/source/deployment/registry/executable/dp_executable.cxx | |
parent | 6dea1afe95aafe1a147e9b933b5cf89530f708b1 (diff) |
desktop/deployment: create instances with uno constructors
See tdf#74608 for motivation
Change-Id: I1559c29286c8877f5fc75cdb293403f5e5e5a538
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98473
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop/source/deployment/registry/executable/dp_executable.cxx')
-rw-r--r-- | desktop/source/deployment/registry/executable/dp_executable.cxx | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/desktop/source/deployment/registry/executable/dp_executable.cxx b/desktop/source/deployment/registry/executable/dp_executable.cxx index 9769051afaca..7631c6402a9a 100644 --- a/desktop/source/deployment/registry/executable/dp_executable.cxx +++ b/desktop/source/deployment/registry/executable/dp_executable.cxx @@ -21,15 +21,14 @@ #include <memory> #include <dp_misc.h> #include <dp_backend.h> -#include <dp_services.hxx> #include <dp_ucb.h> #include <dp_interact.h> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <osl/file.hxx> #include <ucbhelper/content.hxx> -#include <comphelper/servicedecl.hxx> #include <svl/inettype.hxx> #include "dp_executablebackenddb.hxx" +#include <cppuhelper/supportsservice.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -87,6 +86,11 @@ public: BackendImpl( Sequence<Any> const & args, Reference<XComponentContext> const & xComponentContext ); + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override; + // XPackageRegistry virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL getSupportedPackageTypes() override; @@ -111,6 +115,22 @@ BackendImpl::BackendImpl( } } +// XServiceInfo +OUString BackendImpl::getImplementationName() +{ + return "com.sun.star.comp.deployment.executable.PackageRegistryBackend"; +} + +sal_Bool BackendImpl::supportsService( const OUString& ServiceName ) +{ + return cppu::supportsService(this, ServiceName); +} + +css::uno::Sequence< OUString > BackendImpl::getSupportedServiceNames() +{ + return { BACKEND_SERVICE_NAME }; +} + void BackendImpl::addDataToDb(OUString const & url) { if (m_backendDb) @@ -301,14 +321,14 @@ bool BackendImpl::ExecutablePackageImpl::getFileAttributes(sal_uInt64& out_Attri } // anon namespace -namespace sdecl = comphelper::service_decl; -sdecl::class_<BackendImpl, sdecl::with_args<true> > serviceBI; -sdecl::ServiceDecl const serviceDecl( - serviceBI, - "com.sun.star.comp.deployment.executable.PackageRegistryBackend", - BACKEND_SERVICE_NAME ); } // namespace dp_registry::backend::executable +extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* +com_sun_star_comp_deployment_executable_PackageRegistryBackend_get_implementation( + css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const& args) +{ + return cppu::acquire(new dp_registry::backend::executable::BackendImpl(args, context)); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |