summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-01-30 10:32:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-05 07:55:50 +0100
commit25baf8b7e3f0a7e7bef552cba919eb3b24a81a19 (patch)
tree6b4ddf9763781ecffc718896d463a4964e94be7b /svx
parent9d6e774f51998deadae429061715f92a7af1b0b0 (diff)
loplugin:useuniqueptr in ObjectContact
Change-Id: I89104fe93bbb2db4ca7c092784583eac6fbdda08 Reviewed-on: https://gerrit.libreoffice.org/49209 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sdr/contact/objectcontact.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/svx/source/sdr/contact/objectcontact.cxx b/svx/source/sdr/contact/objectcontact.cxx
index 9afa1bd6ed2c..8085cc0e3721 100644
--- a/svx/source/sdr/contact/objectcontact.cxx
+++ b/svx/source/sdr/contact/objectcontact.cxx
@@ -66,12 +66,8 @@ ObjectContact::~ObjectContact() COVERITY_NOEXCEPT_FALSE
DBG_ASSERT(maViewObjectContactVector.empty(), "Corrupted ViewObjectContactList (!)");
// delete the EventHandler. This will destroy all still contained events.
- if(mpEventHandler)
- {
- // If there are still Events registered, something has went wrong
- delete mpEventHandler;
- mpEventHandler = nullptr;
- }
+ mpEventHandler.reset();
+ // If there are still Events registered, something has went wrong
}
// LazyInvalidate request. Default implementation directly handles
@@ -151,7 +147,7 @@ sdr::event::TimerEventHandler& ObjectContact::GetEventHandler() const
{
if(!HasEventHandler())
{
- const_cast< ObjectContact* >(this)->mpEventHandler = new sdr::event::TimerEventHandler();
+ const_cast< ObjectContact* >(this)->mpEventHandler.reset( new sdr::event::TimerEventHandler() );
}
return *mpEventHandler;
}