From c2c530da69152ff9192b9726aa95961803ce9b29 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Wed, 22 Jan 2014 11:54:19 +0100 Subject: Introduce static inline cppu::acquire(), and make use of that. This is much better approach compared to the callback function, as it allows passing arguments to the c++ constructor directly, while still allowing some additional initialization after having acquired the instance. Change-Id: I5a0f981915dd58f1522ee6054e53a3550b29d624 --- stoc/source/defaultregistry/defaultregistry.cxx | 4 ++-- stoc/source/implementationregistration/implreg.cxx | 4 ++-- stoc/source/loader/dllcomponentloader.cxx | 4 ++-- stoc/source/security/access_controller.cxx | 4 ++-- stoc/source/security/file_policy.cxx | 4 ++-- stoc/source/servicemanager/servicemanager.cxx | 12 ++++++------ stoc/source/simpleregistry/simpleregistry.cxx | 4 ++-- 7 files changed, 18 insertions(+), 18 deletions(-) (limited to 'stoc') diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx index 2f09bf5309a2..6c8dbb57b8ba 100644 --- a/stoc/source/defaultregistry/defaultregistry.cxx +++ b/stoc/source/defaultregistry/defaultregistry.cxx @@ -1353,9 +1353,9 @@ void SAL_CALL NestedRegistryImpl::mergeKey( const OUString& aKeyName, const OUSt extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_stoc_NestedRegistry_get_implementation( SAL_UNUSED_PARAMETER css::uno::XComponentContext *, - cppu::constructor_InitializationFunc &) + css::uno::Sequence const &) { - return static_cast(new NestedRegistryImpl); + return cppu::acquire(new NestedRegistryImpl); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx index 8218c2ebdbcb..738f25ad68d9 100644 --- a/stoc/source/implementationregistration/implreg.cxx +++ b/stoc/source/implementationregistration/implreg.cxx @@ -1819,9 +1819,9 @@ Reference< XSimpleRegistry > ImplementationRegistration::createTemporarySimpleRe extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_stoc_ImplementationRegistration_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence const &) { - return static_cast(new ImplementationRegistration(context)); + return cppu::acquire(new ImplementationRegistration(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/stoc/source/loader/dllcomponentloader.cxx b/stoc/source/loader/dllcomponentloader.cxx index e52519cb67ad..9c1283bba5ad 100644 --- a/stoc/source/loader/dllcomponentloader.cxx +++ b/stoc/source/loader/dllcomponentloader.cxx @@ -168,9 +168,9 @@ sal_Bool SAL_CALL DllComponentLoader::writeRegistryInfo( extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_stoc_DLLComponentLoader_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence const &) { - return static_cast(new DllComponentLoader(context)); + return cppu::acquire(new DllComponentLoader(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx index 3fbf8f5c7db6..abc959c056b0 100644 --- a/stoc/source/security/access_controller.cxx +++ b/stoc/source/security/access_controller.cxx @@ -982,9 +982,9 @@ Sequence< OUString > AccessController::getSupportedServiceNames() extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_security_comp_stoc_AccessController_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence const &) { - return static_cast(new AccessController(context)); + return cppu::acquire(new AccessController(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx index 2864b6da6f14..9d646a78f2e2 100644 --- a/stoc/source/security/file_policy.cxx +++ b/stoc/source/security/file_policy.cxx @@ -543,9 +543,9 @@ Sequence< OUString > FilePolicy::getSupportedServiceNames() extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_security_comp_stoc_FilePolicy_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence const &) { - return static_cast(new FilePolicy(context)); + return cppu::acquire(new FilePolicy(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx index 00763d5649d3..0abf06d80198 100644 --- a/stoc/source/servicemanager/servicemanager.cxx +++ b/stoc/source/servicemanager/servicemanager.cxx @@ -1674,25 +1674,25 @@ Any ORegistryServiceManager::getPropertyValue(const OUString& PropertyName) extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_stoc_OServiceManager_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence const &) { - return static_cast(new OServiceManager(context)); + return cppu::acquire(new OServiceManager(context)); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_stoc_ORegistryServiceManager_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence const &) { - return static_cast(new ORegistryServiceManager(context)); + return cppu::acquire(new ORegistryServiceManager(context)); } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_stoc_OServiceManagerWrapper_get_implementation( css::uno::XComponentContext *context, - cppu::constructor_InitializationFunc &) + css::uno::Sequence const &) { - return static_cast(new OServiceManagerWrapper(context)); + return cppu::acquire(new OServiceManagerWrapper(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx index 4927efe24ffa..3f5c8d8c871d 100644 --- a/stoc/source/simpleregistry/simpleregistry.cxx +++ b/stoc/source/simpleregistry/simpleregistry.cxx @@ -1126,9 +1126,9 @@ void SimpleRegistry::mergeKey( extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_stoc_SimpleRegistry_get_implementation( SAL_UNUSED_PARAMETER css::uno::XComponentContext *, - cppu::constructor_InitializationFunc &) + css::uno::Sequence const &) { - return static_cast(new SimpleRegistry); + return cppu::acquire(new SimpleRegistry); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit