sot/source/sdstor/stgstrms.cxx | 4 ++-- sot/source/sdstor/stgstrms.hxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
New commits: commit 3653efd060a50ea40023ebe024352492f27ab925 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Fri Dec 29 19:35:04 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Dec 30 08:13:21 2023 +0100 use more unique_ptr in StgTmpStrm Change-Id: Ib2d598323f94e76e90fc5fef68094dfefba6d3c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161433 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx index 61682ead8ab0..b53a6fdb8dda 100644 --- a/sot/source/sdstor/stgstrms.cxx +++ b/sot/source/sdstor/stgstrms.cxx @@ -1201,7 +1201,7 @@ StgTmpStrm::~StgTmpStrm() { m_pStrm->Close(); osl::File::remove( m_aName ); - delete m_pStrm; + m_pStrm.reset(); } } @@ -1270,7 +1270,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n) SetError( s->GetError() ); return; } - m_pStrm = s.release(); + m_pStrm = std::move(s); // Shrink the memory to 16 bytes, which seems to be the minimum ReAllocateMemory( - ( static_cast<tools::Long>(nEndOfData) - 16 ) ); } diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx index 51c08faf5312..2ef0418f7cc8 100644 --- a/sot/source/sdstor/stgstrms.hxx +++ b/sot/source/sdstor/stgstrms.hxx @@ -148,7 +148,7 @@ public: class StgTmpStrm : public SvMemoryStream { OUString m_aName; - SvFileStream* m_pStrm; + std::unique_ptr<SvFileStream> m_pStrm; using SvMemoryStream::GetData; virtual std::size_t GetData( void* pData, std::size_t nSize ) override; virtual std::size_t PutData( const void* pData, std::size_t nSize ) override;