diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-11 13:04:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-16 06:10:36 +0000 |
commit | 0b272cdf0025ce4bca31ee01c8b3aaca042dcb62 (patch) | |
tree | e5d3ec93289598ebfe0121e7a3d0c880c3054844 /svx/source/svdraw/svdotxln.cxx | |
parent | 570d8dab6d6754ab8020cbe6624020dff7b8b624 (diff) |
new loplugin: useuniqueptr: svx
Change-Id: I0eb3d43d7bcfc491df16a72997a0720a6aec2c5c
Reviewed-on: https://gerrit.libreoffice.org/32959
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/svdraw/svdotxln.cxx')
-rw-r--r-- | svx/source/svdraw/svdotxln.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/svx/source/svdraw/svdotxln.cxx b/svx/source/svdraw/svdotxln.cxx index 20792039e5ee..e6d4d4f6825e 100644 --- a/svx/source/svdraw/svdotxln.cxx +++ b/svx/source/svdraw/svdotxln.cxx @@ -105,7 +105,6 @@ ImpSdrObjTextLinkUserData::ImpSdrObjTextLinkUserData(): ImpSdrObjTextLinkUserData::~ImpSdrObjTextLinkUserData() { - delete pLink; } SdrObjUserData* ImpSdrObjTextLinkUserData::Clone(SdrObject* ) const @@ -258,7 +257,7 @@ void SdrTextObj::ImpLinkAnmeldung() ImpSdrObjTextLinkUserData* pData=GetLinkUserData(); sfx2::LinkManager* pLinkManager=pModel!=nullptr ? pModel->GetLinkManager() : nullptr; if (pLinkManager!=nullptr && pData!=nullptr && pData->pLink==nullptr) { // don't register twice - pData->pLink = new ImpSdrObjTextLink(this); + pData->pLink.reset( new ImpSdrObjTextLink(this) ); pLinkManager->InsertFileLink(*pData->pLink,OBJECT_CLIENT_FILE,pData->aFileName, !pData->aFilterName.isEmpty() ? &pData->aFilterName : nullptr); @@ -271,7 +270,7 @@ void SdrTextObj::ImpLinkAbmeldung() sfx2::LinkManager* pLinkManager=pModel!=nullptr ? pModel->GetLinkManager() : nullptr; if (pLinkManager!=nullptr && pData!=nullptr && pData->pLink!=nullptr) { // don't register twice // when doing Remove, *pLink is deleted implicitly - pLinkManager->Remove( pData->pLink ); + pLinkManager->Remove( pData->pLink.get() ); pData->pLink=nullptr; } } |