diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-02-10 13:23:28 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-02-11 07:57:56 +0100 |
commit | 14cb12bde07b8becf69b648ecc6642bdccf8a7cd (patch) | |
tree | e616a44bdeb412b518e8f4fcee20f9aaeb8574e9 /xmlhelp | |
parent | 5128bf29d5febceaec51854595f23ae487a0cdec (diff) |
loplugin:refcounting generalise type checking
Change-Id: Ia013878ac9c2918d8eaf9aab16b291d8211e708f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110700
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlhelp')
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/databases.cxx | 8 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 583de4123e88..1f1a2868c477 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -24,6 +24,7 @@ #include <rtl/character.hxx> #include <rtl/uri.hxx> #include <rtl/ustrbuf.hxx> +#include <rtl/ref.hxx> #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/awt/Toolkit.hpp> #include <com/sun/star/i18n/Collator.hpp> @@ -802,15 +803,14 @@ Reference< XHierarchicalNameAccess > Databases::jarFile( const OUString& jar, Sequence< Any > aArguments( 2 ); - std::unique_ptr<XInputStream_impl> p(new XInputStream_impl( zipFile )); + rtl::Reference<XInputStream_impl> p(new XInputStream_impl( zipFile )); if( p->CtorSuccess() ) { - Reference< XInputStream > xInputStream( p.release() ); - aArguments[ 0 ] <<= xInputStream; + aArguments[ 0 ] <<= Reference< XInputStream >( p.get() ); } else { - p.reset(); + p.clear(); aArguments[ 0 ] <<= zipFile; } diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index bb1a12bc8243..a4f6d8f89aec 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -25,6 +25,7 @@ #include <cppuhelper/queryinterface.hxx> #include <comphelper/processfactory.hxx> #include <rtl/uri.hxx> +#include <rtl/ref.hxx> #include <rtl/character.hxx> #include <libxslt/transform.h> #include <libxslt/xsltutils.h> @@ -332,7 +333,7 @@ void URLParameter::open( const Reference< XOutputStream >& xDataSink ) return; // a standard document or else an active help text, plug in the new input stream - std::unique_ptr<InputStreamTransformer> p(new InputStreamTransformer( this,m_pDatabases,isRoot() )); + rtl::Reference<InputStreamTransformer> p(new InputStreamTransformer( this,m_pDatabases,isRoot() )); try { xDataSink->writeBytes( Sequence< sal_Int8 >( reinterpret_cast<const sal_Int8*>(p->getData().getStr()), p->getData().getLength() ) ); @@ -340,7 +341,7 @@ void URLParameter::open( const Reference< XOutputStream >& xDataSink ) catch( const Exception& ) { } - p.reset(); + p.clear(); xDataSink->closeOutput(); } |