diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-31 14:46:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-01 12:15:22 +0000 |
commit | 2489000d3fd66319a8355fd4e37cfdfda47296d0 (patch) | |
tree | caad79e7b5bec3863604b20190b682c0d73d2b25 /sw/source/core/unocore/unodraw.cxx | |
parent | 595848c85acc2609fcc48a40c7a9f216a2722cd8 (diff) |
loplugin:useuniqueptr extend to check local vars
just the simple and obvious case for now, of a local var being allocated
and deleted inside a single local block, and the delete happening at the
end of the block
Change-Id: I3a7a094da543debdcd2374737c2ecff91d644625
Reviewed-on: https://gerrit.libreoffice.org/33749
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/unocore/unodraw.cxx')
-rw-r--r-- | sw/source/core/unocore/unodraw.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 35f794a6a206..6681928cce63 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -1124,8 +1124,8 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a } else { - SwUnoInternalPaM* pInternalPam = - new SwUnoInternalPaM( *(pFormat->GetDoc()) ); + std::unique_ptr<SwUnoInternalPaM> pInternalPam( + new SwUnoInternalPaM( *(pFormat->GetDoc()) )); uno::Reference< text::XTextRange > xRg; aValue >>= xRg; if (::sw::XTextRangeToSwPaM(*pInternalPam, xRg) ) @@ -1170,7 +1170,6 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a { throw uno::RuntimeException(); } - delete pInternalPam; } } else if (pEntry->nWID == FN_TEXT_BOX) |