diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-01-16 16:26:55 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-01-20 17:37:40 +0100 |
commit | 306efefe22e02248eff14f8be2cef68d75d26e55 (patch) | |
tree | a6390855a593d27f602932df5ac06490a9ee5ba9 /svtools | |
parent | ef602ba8ce58211c9588d8df72cbde7d48542a1a (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 'svtools')
-rw-r--r-- | svtools/source/filter/SvFilterOptionsDialog.cxx | 4 | ||||
-rw-r--r-- | svtools/source/graphic/graphicunofactory.cxx | 4 | ||||
-rw-r--r-- | svtools/source/graphic/provider.cxx | 4 | ||||
-rw-r--r-- | svtools/source/graphic/renderer.cxx | 4 | ||||
-rw-r--r-- | svtools/source/hatchwindow/documentcloser.cxx | 4 | ||||
-rw-r--r-- | svtools/source/hatchwindow/hatchwindowfactory.cxx | 4 | ||||
-rw-r--r-- | svtools/source/uno/addrtempuno.cxx | 4 | ||||
-rw-r--r-- | svtools/source/uno/wizard/unowizard.cxx | 4 |
8 files changed, 8 insertions, 24 deletions
diff --git a/svtools/source/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter/SvFilterOptionsDialog.cxx index 3d02a9f641d1..8311d83d53cb 100644 --- a/svtools/source/filter/SvFilterOptionsDialog.cxx +++ b/svtools/source/filter/SvFilterOptionsDialog.cxx @@ -304,9 +304,7 @@ com_sun_star_svtools_SvFilterOptionsDialog_get_implementation( css::uno::XComponentContext * context, css::uno::Sequence<css::uno::Any> const &) { - rtl::Reference<SvFilterOptionsDialog> x(new SvFilterOptionsDialog(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new SvFilterOptionsDialog(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/graphic/graphicunofactory.cxx b/svtools/source/graphic/graphicunofactory.cxx index 40c456760465..5ba8db405b0a 100644 --- a/svtools/source/graphic/graphicunofactory.cxx +++ b/svtools/source/graphic/graphicunofactory.cxx @@ -115,9 +115,7 @@ com_sun_star_graphic_GraphicObject_get_implementation( SAL_UNUSED_PARAMETER css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &arguments) { - rtl::Reference<GObjectImpl> x(new GObjectImpl(arguments)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new GObjectImpl(arguments)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index b2ea034b8fd6..9f99ce47f584 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -861,9 +861,7 @@ com_sun_star_comp_graphic_GraphicProvider_get_implementation( css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - rtl::Reference<GraphicProvider> x(new GraphicProvider); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new GraphicProvider); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/graphic/renderer.cxx b/svtools/source/graphic/renderer.cxx index 0621e570a467..40280d8b6ba7 100644 --- a/svtools/source/graphic/renderer.cxx +++ b/svtools/source/graphic/renderer.cxx @@ -297,9 +297,7 @@ com_sun_star_comp_graphic_GraphicRendererVCL_get_implementation( css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - rtl::Reference<GraphicRendererVCL> x(new GraphicRendererVCL); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new GraphicRendererVCL); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/hatchwindow/documentcloser.cxx b/svtools/source/hatchwindow/documentcloser.cxx index 94058f25d8f7..86a64ff7b24c 100644 --- a/svtools/source/hatchwindow/documentcloser.cxx +++ b/svtools/source/hatchwindow/documentcloser.cxx @@ -252,9 +252,7 @@ com_sun_star_comp_embed_DocumentCloser_get_implementation( SAL_UNUSED_PARAMETER css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &arguments) { - rtl::Reference<ODocumentCloser> x(new ODocumentCloser(arguments)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new ODocumentCloser(arguments)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx index afa3f3322533..2a581d07ced3 100644 --- a/svtools/source/hatchwindow/hatchwindowfactory.cxx +++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx @@ -89,9 +89,7 @@ com_sun_star_comp_embed_HatchWindowFactory_get_implementation( css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - rtl::Reference<OHatchWindowFactory> x(new OHatchWindowFactory); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new OHatchWindowFactory); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/uno/addrtempuno.cxx b/svtools/source/uno/addrtempuno.cxx index 73b2c18ec010..c90b4c07d8c2 100644 --- a/svtools/source/uno/addrtempuno.cxx +++ b/svtools/source/uno/addrtempuno.cxx @@ -228,9 +228,7 @@ com_sun_star_comp_svtools_OAddressBookSourceDialogUno_get_implementation( css::uno::XComponentContext * context, css::uno::Sequence<css::uno::Any> const &) { - rtl::Reference<OAddressBookSourceDialogUno> x(new OAddressBookSourceDialogUno(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new OAddressBookSourceDialogUno(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx index 7fbd2d4b6cd8..870315357eb1 100644 --- a/svtools/source/uno/wizard/unowizard.cxx +++ b/svtools/source/uno/wizard/unowizard.cxx @@ -502,9 +502,7 @@ com_sun_star_comp_svtools_uno_Wizard_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence<css::uno::Any> const &) { - rtl::Reference<Wizard> x(new Wizard(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new Wizard(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |