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 /sax/source | |
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 'sax/source')
-rw-r--r-- | sax/source/expatwrap/sax_expat.cxx | 4 | ||||
-rw-r--r-- | sax/source/expatwrap/saxwriter.cxx | 4 | ||||
-rw-r--r-- | sax/source/fastparser/fastparser.cxx | 4 |
3 files changed, 3 insertions, 9 deletions
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index 12066dc92b91..7d5e36cabf80 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -1025,9 +1025,7 @@ com_sun_star_comp_extensions_xml_sax_ParserExpat_get_implementation( css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - rtl::Reference<SaxExpatParser> x(new SaxExpatParser); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new SaxExpatParser); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx index be86b61d18f4..73cb50ff74fe 100644 --- a/sax/source/expatwrap/saxwriter.cxx +++ b/sax/source/expatwrap/saxwriter.cxx @@ -1375,9 +1375,7 @@ com_sun_star_extensions_xml_sax_Writer_get_implementation( css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - rtl::Reference<SAXWriter> x(new SAXWriter); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new SAXWriter); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 57bff21ed59f..152c22da376a 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -1431,9 +1431,7 @@ com_sun_star_comp_extensions_xml_sax_FastParser_get_implementation( css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - rtl::Reference<FastSaxParser> x(new FastSaxParser); - x->acquire(); - return static_cast<cppu::OWeakObject *>(x.get()); + return static_cast<cppu::OWeakObject *>(new FastSaxParser); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |