summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2020-07-21 21:22:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-22 08:30:21 +0200
commitb625194763b43ed09872947165bf3ad4431eb355 (patch)
tree8b8d22481ac94ec25d0100716c765c9322a9e592 /ucb
parent00c7afecc319061b70b77a709ca2ae9583df4145 (diff)
ucb/expand: create instances with uno constructors
See tdf#74608 for motivation. Change-Id: I83f75a1d107a74c1c9707243caf323b630f0b33f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99178 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/expand/ucpexpand.cxx55
-rw-r--r--ucb/source/ucp/expand/ucpexpand1.component5
2 files changed, 12 insertions, 48 deletions
diff --git a/ucb/source/ucp/expand/ucpexpand.cxx b/ucb/source/ucp/expand/ucpexpand.cxx
index 8cd7818d6037..aa2f7a87dd2e 100644
--- a/ucb/source/ucp/expand/ucpexpand.cxx
+++ b/ucb/source/ucp/expand/ucpexpand.cxx
@@ -102,41 +102,22 @@ void ExpandContentProviderImpl::disposing()
}
-uno::Reference< uno::XInterface > create(
- uno::Reference< uno::XComponentContext > const & xComponentContext )
-{
- return static_cast< ::cppu::OWeakObject * >(
- new ExpandContentProviderImpl( xComponentContext ) );
-}
-
-
-OUString implName()
-{
- return "com.sun.star.comp.ucb.ExpandContentProvider";
-}
-
-
-uno::Sequence< OUString > supportedServices()
-{
- return uno::Sequence< OUString > {
- OUString("com.sun.star.ucb.ExpandContentProvider"),
- OUString("com.sun.star.ucb.ContentProvider")
- };
-}
-
// XServiceInfo
OUString ExpandContentProviderImpl::getImplementationName()
{
check();
- return implName();
+ return "com.sun.star.comp.ucb.ExpandContentProvider";
}
uno::Sequence< OUString > ExpandContentProviderImpl::getSupportedServiceNames()
{
check();
- return supportedServices();
+ return {
+ "com.sun.star.ucb.ExpandContentProvider",
+ "com.sun.star.ucb.ContentProvider"
+ };
}
sal_Bool ExpandContentProviderImpl::supportsService(OUString const & serviceName )
@@ -204,32 +185,14 @@ sal_Int32 ExpandContentProviderImpl::compareContentIds(
}
}
-const ::cppu::ImplementationEntry s_entries [] =
-{
- {
- create,
- implName,
- supportedServices,
- ::cppu::createSingleComponentFactory,
- nullptr, 0
- },
- { nullptr, nullptr, nullptr, nullptr, nullptr, 0 }
-};
}
-extern "C"
-{
-
-SAL_DLLPUBLIC_EXPORT void * ucpexpand1_component_getFactory(
- const char * pImplName,
- void * pServiceManager,
- void * pRegistryKey )
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
+ucb_expand_ExpandContentProviderImpl_get_implementation(
+ css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any> const&)
{
- return ::cppu::component_getFactoryHelper(
- pImplName, pServiceManager, pRegistryKey, s_entries );
-}
-
+ return cppu::acquire(new ExpandContentProviderImpl(context));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/expand/ucpexpand1.component b/ucb/source/ucp/expand/ucpexpand1.component
index ba7c7e90e005..480974a4d313 100644
--- a/ucb/source/ucp/expand/ucpexpand1.component
+++ b/ucb/source/ucp/expand/ucpexpand1.component
@@ -18,8 +18,9 @@
-->
<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
- prefix="ucpexpand1" xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.ucb.ExpandContentProvider">
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.ucb.ExpandContentProvider"
+ constructor="ucb_expand_ExpandContentProviderImpl_get_implementation">
<service name="com.sun.star.ucb.ExpandContentProvider"/>
</implementation>
</component>