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 /svx/source/unodraw | |
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 'svx/source/unodraw')
-rw-r--r-- | svx/source/unodraw/UnoGraphicExporter.cxx | 4 | ||||
-rw-r--r-- | svx/source/unodraw/recoveryui.cxx | 4 | ||||
-rw-r--r-- | svx/source/unodraw/unoctabl.cxx | 4 | ||||
-rw-r--r-- | svx/source/unodraw/unoshcol.cxx | 4 |
4 files changed, 4 insertions, 12 deletions
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 7a611be3cf3b..ace45e8466f0 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -1285,9 +1285,7 @@ com_sun_star_comp_Draw_GraphicExporter_get_implementation( css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - rtl::Reference<GraphicExporter> x(new GraphicExporter); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new GraphicExporter); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx index 5fdb5f228eaa..ea34f6c1cb10 100644 --- a/svx/source/unodraw/recoveryui.cxx +++ b/svx/source/unodraw/recoveryui.cxx @@ -425,9 +425,7 @@ com_sun_star_comp_svx_RecoveryUI_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence<css::uno::Any> const &) { - rtl::Reference<RecoveryUI> x(new RecoveryUI(context)); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new RecoveryUI(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx index b707904edd52..ec8fcc848d18 100644 --- a/svx/source/unodraw/unoctabl.cxx +++ b/svx/source/unodraw/unoctabl.cxx @@ -190,9 +190,7 @@ com_sun_star_drawing_SvxUnoColorTable_get_implementation( css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - rtl::Reference<SvxUnoColorTable> x(new SvxUnoColorTable); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new SvxUnoColorTable); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx index 8b873acf6ed1..a3d187a2b15d 100644 --- a/svx/source/unodraw/unoshcol.cxx +++ b/svx/source/unodraw/unoshcol.cxx @@ -274,9 +274,7 @@ com_sun_star_drawing_SvxShapeCollection_get_implementation( css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - rtl::Reference<SvxShapeCollection> x(new SvxShapeCollection); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new SvxShapeCollection); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |