summaryrefslogtreecommitdiff
path: root/unotools/source/ucbhelper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-10 12:30:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-01-11 12:47:37 +0100
commite57a036939e27ecd173ace691689e26a6a33df8e (patch)
treea36d589da272c4732cddb4ca0548cdb5dcb2b2bd /unotools/source/ucbhelper
parentcb5d79b504aa8575ea15c777707c7465ea43cb07 (diff)
loplugin:useuniqueptr in tools,stoc,unotools
Change-Id: Ia72b65577143623cedc7a40bc34f7fb897add097 Reviewed-on: https://gerrit.libreoffice.org/47726 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools/source/ucbhelper')
-rw-r--r--unotools/source/ucbhelper/tempfile.cxx17
1 files changed, 6 insertions, 11 deletions
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx
index 47afc2ed82ce..9d4c717ed3ae 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -373,16 +373,15 @@ TempFile::TempFile( const OUString& rLeadingChars, bool _bStartWithZero,
}
TempFile::TempFile(TempFile && other):
- aName(std::move(other.aName)), pStream(other.pStream), bIsDirectory(other.bIsDirectory),
+ aName(std::move(other.aName)), pStream(std::move(other.pStream)), bIsDirectory(other.bIsDirectory),
bKillingFileEnabled(other.bKillingFileEnabled)
{
- other.pStream = nullptr;
other.bKillingFileEnabled = false;
}
TempFile::~TempFile()
{
- delete pStream;
+ pStream.reset();
if ( bKillingFileEnabled )
{
if ( bIsDirectory )
@@ -420,21 +419,17 @@ SvStream* TempFile::GetStream( StreamMode eMode )
if (!pStream)
{
if (!aName.isEmpty())
- pStream = new SvFileStream(aName, eMode);
+ pStream.reset(new SvFileStream(aName, eMode));
else
- pStream = new SvMemoryStream(nullptr, 0, eMode);
+ pStream.reset(new SvMemoryStream(nullptr, 0, eMode));
}
- return pStream;
+ return pStream.get();
}
void TempFile::CloseStream()
{
- if ( pStream )
- {
- delete pStream;
- pStream = nullptr;
- }
+ pStream.reset();
}
OUString TempFile::SetTempNameBaseDirectory( const OUString &rBaseName )