summaryrefslogtreecommitdiff
path: root/stoc
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2014-01-16 16:26:55 +0100
committerJan Holesovsky <kendy@collabora.com>2014-01-20 17:37:40 +0100
commit306efefe22e02248eff14f8be2cef68d75d26e55 (patch)
treea6390855a593d27f602932df5ac06490a9ee5ba9 /stoc
parentef602ba8ce58211c9588d8df72cbde7d48542a1a (diff)
Minimize the constructor functions to a bare minimum.
Most of the constructors are supposed to be only a call of new TheInstance(arguments) or an equivalent; so let's just change the constructor caller accordingly, to accept unacquired new instance. If there are exceptions that need to do more heavy lifting, they do not have to use the constructor feature, or there can be a wrapper for the real implementation, doing the additional work in their (C++) constructor. Change-Id: I035c378778aeda60d15af4e56ca3761c586d5ded
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/defaultregistry/defaultregistry.cxx4
-rw-r--r--stoc/source/implementationregistration/implreg.cxx4
-rw-r--r--stoc/source/loader/dllcomponentloader.cxx4
-rw-r--r--stoc/source/security/access_controller.cxx4
-rw-r--r--stoc/source/security/file_policy.cxx4
-rw-r--r--stoc/source/servicemanager/servicemanager.cxx12
-rw-r--r--stoc/source/simpleregistry/simpleregistry.cxx4
7 files changed, 9 insertions, 27 deletions
diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx
index c1c07e17079e..a5446f2d30f0 100644
--- a/stoc/source/defaultregistry/defaultregistry.cxx
+++ b/stoc/source/defaultregistry/defaultregistry.cxx
@@ -1355,9 +1355,7 @@ com_sun_star_comp_stoc_NestedRegistry_get_implementation(
SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- rtl::Reference<NestedRegistryImpl> x(new NestedRegistryImpl);
- x->acquire();
- return static_cast<cppu::OWeakObject *>(x.get());
+ return static_cast<cppu::OWeakObject *>(new NestedRegistryImpl);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx
index e5daf98392f8..e594dbda1a06 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -1821,9 +1821,7 @@ com_sun_star_comp_stoc_ImplementationRegistration_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- rtl::Reference<ImplementationRegistration> x(new ImplementationRegistration(context));
- x->acquire();
- return static_cast<cppu::OWeakObject *>(x.get());
+ return static_cast<cppu::OWeakObject *>(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 14fc172cd4a6..4b90cdc133f0 100644
--- a/stoc/source/loader/dllcomponentloader.cxx
+++ b/stoc/source/loader/dllcomponentloader.cxx
@@ -170,9 +170,7 @@ com_sun_star_comp_stoc_DLLComponentLoader_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- rtl::Reference<DllComponentLoader> x(new DllComponentLoader(context));
- x->acquire();
- return static_cast<cppu::OWeakObject *>(x.get());
+ return static_cast<cppu::OWeakObject *>(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 2e6c84bac924..90d46f7727c8 100644
--- a/stoc/source/security/access_controller.cxx
+++ b/stoc/source/security/access_controller.cxx
@@ -984,9 +984,7 @@ com_sun_star_security_comp_stoc_AccessController_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- rtl::Reference<AccessController> x(new AccessController(context));
- x->acquire();
- return static_cast<cppu::OWeakObject *>(x.get());
+ return static_cast<cppu::OWeakObject *>(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 4cd5e8c000ab..6766aff2f8f2 100644
--- a/stoc/source/security/file_policy.cxx
+++ b/stoc/source/security/file_policy.cxx
@@ -545,9 +545,7 @@ com_sun_star_security_comp_stoc_FilePolicy_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- rtl::Reference<FilePolicy> x(new FilePolicy(context));
- x->acquire();
- return static_cast<cppu::OWeakObject *>(x.get());
+ return static_cast<cppu::OWeakObject *>(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 1dd406ec89e0..9d206c44a9d2 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -1676,9 +1676,7 @@ com_sun_star_comp_stoc_OServiceManager_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- rtl::Reference<OServiceManager> x(new OServiceManager(context));
- x->acquire();
- return static_cast<cppu::OWeakObject *>(x.get());
+ return static_cast<cppu::OWeakObject *>(new OServiceManager(context));
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1686,9 +1684,7 @@ com_sun_star_comp_stoc_ORegistryServiceManager_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- rtl::Reference<ORegistryServiceManager> x(new ORegistryServiceManager(context));
- x->acquire();
- return static_cast<cppu::OWeakObject *>(x.get());
+ return static_cast<cppu::OWeakObject *>(new ORegistryServiceManager(context));
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1696,9 +1692,7 @@ com_sun_star_comp_stoc_OServiceManagerWrapper_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- rtl::Reference<OServiceManagerWrapper> x(new OServiceManagerWrapper(context));
- x->acquire();
- return static_cast<cppu::OWeakObject *>(x.get());
+ return static_cast<cppu::OWeakObject *>(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 96230e17ab97..bddc67be127d 100644
--- a/stoc/source/simpleregistry/simpleregistry.cxx
+++ b/stoc/source/simpleregistry/simpleregistry.cxx
@@ -1128,9 +1128,7 @@ com_sun_star_comp_stoc_SimpleRegistry_get_implementation(
SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- rtl::Reference<SimpleRegistry> x(new SimpleRegistry);
- x->acquire();
- return static_cast<cppu::OWeakObject *>(x.get());
+ return static_cast<cppu::OWeakObject *>(new SimpleRegistry);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */