diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-31 15:40:25 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-12 08:43:48 +0200 |
commit | e4e4d5713e248f02faf7aa6199b11e152973de8e (patch) | |
tree | 836dffa89d0a966e41b1af8270db74b9590def22 /svx/source/sdr | |
parent | d4eabd5da8ea3b5ac40659c22cde19b26b3c002b (diff) |
clang-tidy readability-delete-null-pointer
which in turn triggered some loplugin:useuniqueptr
Change-Id: I0c38561fc9b68dac44e8cf58c8aa1f582196cc64
Reviewed-on: https://gerrit.libreoffice.org/38281
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/sdr')
-rw-r--r-- | svx/source/sdr/contact/viewobjectcontactofgraphic.cxx | 13 | ||||
-rw-r--r-- | svx/source/sdr/properties/textproperties.cxx | 5 |
2 files changed, 4 insertions, 14 deletions
diff --git a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx index 3b42c3837ebe..16c15b41909b 100644 --- a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx @@ -112,7 +112,7 @@ namespace sdr // Trigger asynchronious SwapIn. sdr::event::TimerEventHandler& rEventHandler = rObjectContact.GetEventHandler(); - mpAsynchLoadEvent = new sdr::event::AsynchGraphicLoadingEvent(rEventHandler, *this); + mpAsynchLoadEvent.reset( new sdr::event::AsynchGraphicLoadingEvent(rEventHandler, *this) ); } } else @@ -142,7 +142,7 @@ namespace sdr { // just delete it, this will remove it from the EventHandler and // will trigger forgetAsynchGraphicLoadingEvent from the destructor - delete mpAsynchLoadEvent; + mpAsynchLoadEvent.reset(); // Invalidate paint areas. // [1] If a calc document with graphics is loaded then OnLoad will @@ -222,7 +222,7 @@ namespace sdr if(mpAsynchLoadEvent) { - OSL_ENSURE(!pEvent || mpAsynchLoadEvent == pEvent, + OSL_ENSURE(!pEvent || mpAsynchLoadEvent.get() == pEvent, "ViewObjectContactOfGraphic::forgetAsynchGraphicLoadingEvent: Forced to forget another event then I have scheduled (?)"); // forget event @@ -302,13 +302,6 @@ namespace sdr ViewObjectContactOfGraphic::~ViewObjectContactOfGraphic() { - // evtl. delete the asynch loading event - if(mpAsynchLoadEvent) - { - // just delete it, this will remove it from the EventHandler and - // will trigger forgetAsynchGraphicLoadingEvent from the destructor - delete mpAsynchLoadEvent; - } } } // end of namespace contact } // end of namespace sdr diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx index 8cc07bdd9353..b2d840c763fe 100644 --- a/svx/source/sdr/properties/textproperties.cxx +++ b/svx/source/sdr/properties/textproperties.cxx @@ -337,10 +337,7 @@ namespace sdr } } - if(pTempSet) - { - delete pTempSet; - } + delete pTempSet; } OutlinerParaObject* pTemp = rOutliner.CreateParaObject(0, nParaCount); |