ucb/source/ucp/file/filtask.cxx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
New commits: commit c01c3467f159775c9fa5f1bb2408ec3120dc151e Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Wed Sep 25 07:40:55 2019 +0200 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Wed Sep 25 09:03:44 2019 +0200 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 <sberg...@redhat.com> 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 <com/sun/star/ucb/OpenCommandArgument.hpp> #include <com/sun/star/ucb/Store.hpp> #include <comphelper/propertysequence.hxx> +#include <rtl/ref.hxx> #include <rtl/uri.hxx> #include "filtask.hxx" @@ -716,7 +717,7 @@ TaskManager::open( sal_Int32 CommandId, const OUString& aUnqPath, bool bLock ) { - std::unique_ptr<XInputStream_impl> pInputStream(new XInputStream_impl( aUnqPath, bLock )); // from filinpstr.hxx + rtl::Reference<XInputStream_impl> 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<XStream_impl> pStream(new XStream_impl( aUnqPath, bLock )); // from filstr.hxx + rtl::Reference<XStream_impl> 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<XResultSet_impl> p(new XResultSet_impl( this,aUnqPath,OpenMode,seq,seqSort )); + rtl::Reference<XResultSet_impl> 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() ); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits