diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-28 13:48:17 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-29 08:40:31 +0200 |
commit | 35c165e46a1bc22bc4c5b51ec7b03216fa43ec64 (patch) | |
tree | a27f1d07e3abd7577595e4e22a7146883373a076 /sw/source | |
parent | b75d084f673d0a7e4845a59b5446a4bfafb37fd6 (diff) |
loplugin:useuniqueptr in SwTextAPIObject
Change-Id: Ied235aefe2cc2ce5e88487503c17e1a54d25ac52
Reviewed-on: https://gerrit.libreoffice.org/56624
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/fields/docufld.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/fields/textapi.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/inc/textapi.hxx | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index efc433cce0c7..c89f26f4b2e0 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -1826,7 +1826,7 @@ void SwPostItField::SetTextObject( OutlinerParaObject* pText ) sal_Int32 SwPostItField::GetNumberOfParagraphs() const { - return (mpText) ? mpText->Count() : 1; + return mpText ? mpText->Count() : 1; } bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const diff --git a/sw/source/core/fields/textapi.cxx b/sw/source/core/fields/textapi.cxx index 05372f70faff..89c248eb06cb 100644 --- a/sw/source/core/fields/textapi.cxx +++ b/sw/source/core/fields/textapi.cxx @@ -61,7 +61,7 @@ SwTextAPIObject::SwTextAPIObject( SwTextAPIEditSource* p ) SwTextAPIObject::~SwTextAPIObject() throw() { pSource->Dispose(); - delete pSource; + pSource.reset(); } struct SwTextAPIEditSource_Impl diff --git a/sw/source/core/inc/textapi.hxx b/sw/source/core/inc/textapi.hxx index 4b3fa15628f4..02a138fc764f 100644 --- a/sw/source/core/inc/textapi.hxx +++ b/sw/source/core/inc/textapi.hxx @@ -53,7 +53,7 @@ public: class SwTextAPIObject : public SvxUnoText { - SwTextAPIEditSource* pSource; + std::unique_ptr<SwTextAPIEditSource> pSource; public: SwTextAPIObject( SwTextAPIEditSource* p); virtual ~SwTextAPIObject() throw() override; |