summaryrefslogtreecommitdiff
path: root/ucb/source/ucp/package/pkgprovider.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-07-22 13:59:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-22 17:48:06 +0200
commit950d7d4d51e68cfae3a5d0d23a3d39e84e548357 (patch)
tree21773d3298f0367b4b99c34da9de75b87acfd12f /ucb/source/ucp/package/pkgprovider.cxx
parentb115d4899d827f885f7d35ced4cb64d2385e3422 (diff)
ucb/package: create instances with uno constructors
See tdf#74608 for motivation. Change-Id: Id93f1e18d6646e3747443678bf3d56fa75cb46ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99223 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb/source/ucp/package/pkgprovider.cxx')
-rw-r--r--ucb/source/ucp/package/pkgprovider.cxx40
1 files changed, 18 insertions, 22 deletions
diff --git a/ucb/source/ucp/package/pkgprovider.cxx b/ucb/source/ucp/package/pkgprovider.cxx
index 1183879b1d05..775ee6a5c692 100644
--- a/ucb/source/ucp/package/pkgprovider.cxx
+++ b/ucb/source/ucp/package/pkgprovider.cxx
@@ -140,38 +140,25 @@ XTYPEPROVIDER_IMPL_3( ContentProvider,
// XServiceInfo methods.
-XSERVICEINFO_COMMOM_IMPL( ContentProvider,
- "com.sun.star.comp.ucb.PackageContentProvider" )
-/// @throws css::uno::Exception
-static css::uno::Reference< css::uno::XInterface >
-ContentProvider_CreateInstance( const css::uno::Reference< css::lang::XMultiServiceFactory> & rSMgr )
+OUString
+ContentProvider::getImplementationName()
{
- css::lang::XServiceInfo* pX = new ContentProvider( ucbhelper::getComponentContext(rSMgr) );
- return css::uno::Reference< css::uno::XInterface >::query( pX );
+ return "com.sun.star.comp.ucb.PackageContentProvider";
}
-css::uno::Sequence< OUString >
-ContentProvider::getSupportedServiceNames_Static()
+sal_Bool
+ContentProvider::supportsService(const OUString& s)
{
- css::uno::Sequence< OUString > aSNS { "com.sun.star.ucb.PackageContentProvider" };
- return aSNS;
+ return cppu::supportsService(this, s);
}
-// Service factory implementation.
-
-
-css::uno::Reference< css::lang::XSingleServiceFactory >
-ContentProvider::createServiceFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxServiceMgr )
+css::uno::Sequence< OUString >
+ContentProvider::getSupportedServiceNames()
{
- return cppu::createOneInstanceFactory(
- rxServiceMgr,
- ContentProvider::getImplementationName_Static(),
- ContentProvider_CreateInstance,
- ContentProvider::getSupportedServiceNames_Static() );
+ return { "com.sun.star.ucb.PackageContentProvider" };
}
-
// XContentProvider methods.
@@ -276,4 +263,13 @@ void ContentProvider::removePackage( const OUString & rName )
}
}
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+ucb_package_ContentProvider_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
+{
+ static rtl::Reference<ContentProvider> g_Instance(new ContentProvider(context));
+ g_Instance->acquire();
+ return static_cast<cppu::OWeakObject*>(g_Instance.get());
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */