summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2023-12-29 19:35:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-12-30 08:13:21 +0100
commit3653efd060a50ea40023ebe024352492f27ab925 (patch)
treebccdf400b7b5a448a0c497c63b1fb56cc9fb6b98 /sot
parent2ffe4a6580a17d178794fabeba6916c1ff4c744c (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'sot')
-rw-r--r--sot/source/sdstor/stgstrms.cxx4
-rw-r--r--sot/source/sdstor/stgstrms.hxx2
2 files changed, 3 insertions, 3 deletions
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;