summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-11 15:21:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-12 09:00:07 +0200
commit867cfc57d8bcca1e1c9ea8e63595b618c55fc840 (patch)
treee8939ed4a2d8d15e8ec3b3164fab896206a63668 /forms
parent790c1e3facc67f11e102b5ae2aa879b3430022cb (diff)
loplugin:useuniqueptr in ODatabaseForm::GetDataMultiPartEncoded
Change-Id: Ica70b20b84a8ada5b37cb6d23ce67096bd9ced2d Reviewed-on: https://gerrit.libreoffice.org/60352 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/DatabaseForm.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index afdd2a5e78a3..3a18e057949f 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -495,13 +495,13 @@ Sequence<sal_Int8> ODatabaseForm::GetDataMultiPartEncoded(const Reference<XContr
// Copy MessageStream to SvStream
SvMemoryStream aMemStream;
- char* pBuf = new char[1025];
+ std::unique_ptr<char[]> pBuf(new char[1025]);
int nRead;
- while( (nRead = aMessStream.Read(pBuf, 1024)) > 0 )
+ while( (nRead = aMessStream.Read(pBuf.get(), 1024)) > 0 )
{
- aMemStream.WriteBytes(pBuf, nRead);
+ aMemStream.WriteBytes(pBuf.get(), nRead);
}
- delete[] pBuf;
+ pBuf.reset();
aMemStream.Flush();
aMemStream.Seek( 0 );