From c01c3467f159775c9fa5f1bb2408ec3120dc151e Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 25 Sep 2019 07:40:55 +0200 Subject: Better use rtl::Reference to hold ref-counted UNO objects Change-Id: I515ddde31730c95fdeee9f9a64a35605c2d01c2c Reviewed-on: https://gerrit.libreoffice.org/79483 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- ucb/source/ucp/file/filtask.cxx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'ucb') diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx index b9a83a186dff..3e3afd149c5a 100644 --- a/ucb/source/ucp/file/filtask.cxx +++ b/ucb/source/ucp/file/filtask.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include "filtask.hxx" @@ -716,7 +717,7 @@ TaskManager::open( sal_Int32 CommandId, const OUString& aUnqPath, bool bLock ) { - std::unique_ptr pInputStream(new XInputStream_impl( aUnqPath, bLock )); // from filinpstr.hxx + rtl::Reference pInputStream(new XInputStream_impl( aUnqPath, bLock )); // from filinpstr.hxx sal_Int32 ErrorCode = pInputStream->CtorSuccess(); @@ -726,10 +727,10 @@ TaskManager::open( sal_Int32 CommandId, ErrorCode, pInputStream->getMinorError() ); - pInputStream.reset(); + pInputStream.clear(); } - return uno::Reference< io::XInputStream >( pInputStream.release() ); + return uno::Reference< io::XInputStream >( pInputStream.get() ); } @@ -748,7 +749,7 @@ TaskManager::open_rw( sal_Int32 CommandId, const OUString& aUnqPath, bool bLock ) { - std::unique_ptr pStream(new XStream_impl( aUnqPath, bLock )); // from filstr.hxx + rtl::Reference pStream(new XStream_impl( aUnqPath, bLock )); // from filstr.hxx sal_Int32 ErrorCode = pStream->CtorSuccess(); @@ -758,9 +759,9 @@ TaskManager::open_rw( sal_Int32 CommandId, ErrorCode, pStream->getMinorError() ); - pStream.reset(); + pStream.clear(); } - return uno::Reference< io::XStream >( pStream.release() ); + return uno::Reference< io::XStream >( pStream.get() ); } @@ -781,7 +782,7 @@ TaskManager::ls( sal_Int32 CommandId, const uno::Sequence< beans::Property >& seq, const uno::Sequence< NumberedSortingInfo >& seqSort ) { - std::unique_ptr p(new XResultSet_impl( this,aUnqPath,OpenMode,seq,seqSort )); + rtl::Reference p(new XResultSet_impl( this,aUnqPath,OpenMode,seq,seqSort )); sal_Int32 ErrorCode = p->CtorSuccess(); @@ -791,10 +792,10 @@ TaskManager::ls( sal_Int32 CommandId, ErrorCode, p->getMinorError() ); - p.reset(); + p.clear(); } - return uno::Reference< XDynamicResultSet > ( p.release() ); + return uno::Reference< XDynamicResultSet > ( p.get() ); } -- cgit