summaryrefslogtreecommitdiff
path: root/forms/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-10-17 12:04:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-10-17 12:58:33 +0200
commit01b9fdb2712e1a10e9a24b11976bb4fb94ac5bd9 (patch)
treeca63ab42450d81ea3a4b2df04f704ed47db07bb7 /forms/source
parentd728492f4aa195fd4aec3ddb116879de76a95c6d (diff)
loplugin:useuniqueptr in tools/inetmsg.hxx
Change-Id: Ifdf0da7f59af1777f214cbafeb75b46136775f67 Reviewed-on: https://gerrit.libreoffice.org/43450 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms/source')
-rw-r--r--forms/source/component/DatabaseForm.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 4c2b039442cc..73bbd8a8afcc 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -938,10 +938,8 @@ void ODatabaseForm::Encode( OUString& rString )
void ODatabaseForm::InsertTextPart( INetMIMEMessage& rParent, const OUString& rName,
const OUString& rData )
{
-
// Create part as MessageChild
- INetMIMEMessage* pChild = new INetMIMEMessage();
-
+ std::unique_ptr<INetMIMEMessage> pChild(new INetMIMEMessage);
// Header
//TODO: Encode rName into a properly formatted Content-Disposition header
@@ -965,7 +963,7 @@ void ODatabaseForm::InsertTextPart( INetMIMEMessage& rParent, const OUString& rN
pStream->Flush();
pStream->Seek( 0 );
pChild->SetDocumentLB( new SvLockBytes(pStream, true) );
- rParent.AttachChild( *pChild );
+ rParent.AttachChild( std::move(pChild) );
}
@@ -1005,7 +1003,7 @@ bool ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const OUString& rN
// Create part as MessageChild
- INetMIMEMessage* pChild = new INetMIMEMessage;
+ std::unique_ptr<INetMIMEMessage> pChild(new INetMIMEMessage);
// Header
@@ -1025,7 +1023,7 @@ bool ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const OUString& rN
// Body
pChild->SetDocumentLB( new SvLockBytes(pStream, true) );
- rParent.AttachChild( *pChild );
+ rParent.AttachChild( std::move(pChild) );
return true;
}