From 73eca35b0a8e01a7be2ce1775d1937154b5efb9e Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Sat, 18 Jan 2014 10:51:50 +0100 Subject: Unify ctor functions for component implementations. There is no need to use different styles for writing the same thing. It also makes it easier in future to use search & replace. But of course, there are also some more complicated functions. Change-Id: I773da20378af0e0d5a27689d3903df7063fb8ac0 --- sax/source/expatwrap/sax_expat.cxx | 8 ++++---- sax/source/expatwrap/saxwriter.cxx | 11 ++++------- sax/source/fastparser/fastparser.cxx | 7 +++---- 3 files changed, 11 insertions(+), 15 deletions(-) (limited to 'sax') diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index 456aca2f50e5..12066dc92b91 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -1021,13 +1022,12 @@ void SaxExpatParser_Impl::callbackEndCDATA( void *pvThis ) extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_extensions_xml_sax_ParserExpat_get_implementation( - SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + css::uno::XComponentContext *, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new SaxExpatParser)); + rtl::Reference x(new SaxExpatParser); x->acquire(); - return x.get(); + return static_cast(x.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx index 7f0d498ae2cc..be86b61d18f4 100644 --- a/sax/source/expatwrap/saxwriter.cxx +++ b/sax/source/expatwrap/saxwriter.cxx @@ -36,11 +36,9 @@ #include #include -#include -#include +#include #include -using namespace ::rtl; using namespace ::std; using namespace ::osl; using namespace ::cppu; @@ -1374,13 +1372,12 @@ void SAXWriter::unknown(const OUString& sString) throw (SAXException, RuntimeExc extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_extensions_xml_sax_Writer_get_implementation( - SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + css::uno::XComponentContext *, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new SAXWriter)); + rtl::Reference x(new SAXWriter); x->acquire(); - return x.get(); + return static_cast(x.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx index 5f86b88bf5dc..57bff21ed59f 100644 --- a/sax/source/fastparser/fastparser.cxx +++ b/sax/source/fastparser/fastparser.cxx @@ -1428,13 +1428,12 @@ bool FastSaxParser::hasNamespaceURL( const OUString& rPrefix ) const extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL com_sun_star_comp_extensions_xml_sax_FastParser_get_implementation( - SAL_UNUSED_PARAMETER css::uno::XComponentContext *, + css::uno::XComponentContext *, css::uno::Sequence const &) { - css::uno::Reference x( - static_cast(new FastSaxParser)); + rtl::Reference x(new FastSaxParser); x->acquire(); - return x.get(); + return static_cast(x.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit