diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-03 10:22:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-04 08:35:52 +0200 |
commit | 2720dbe9f79b6d954f40b9b50aeb8ddd267a4b36 (patch) | |
tree | b1dbccb720fed0d86110e1d720026074f851920a | |
parent | ac49eb6ef947e21504d7f20d2d5e9fea4dbd263f (diff) |
loplugin:useuniqueptr in ScDrawView
Change-Id: Idbc47bdb3ff16d29a93365654b36b047c564de70
Reviewed-on: https://gerrit.libreoffice.org/56906
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sc/source/ui/inc/drawview.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/drawview.cxx | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx index ad353cdd7a29..ce2af6a66b58 100644 --- a/sc/source/ui/inc/drawview.hxx +++ b/sc/source/ui/inc/drawview.hxx @@ -39,7 +39,7 @@ class ScDrawView final : public FmFormView SCTAB nTab; Fraction aScaleX; // Factor for Drawing-MapMode Fraction aScaleY; - SdrDropMarkerOverlay* pDropMarker; + std::unique_ptr<SdrDropMarkerOverlay> pDropMarker; SdrObject* pDropMarkObj; bool bInConstruct; diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 51b281c91b3f..ca10345efed0 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -123,11 +123,7 @@ void ScDrawView::Construct() void ScDrawView::ImplClearCalcDropMarker() { - if(pDropMarker) - { - delete pDropMarker; - pDropMarker = nullptr; - } + pDropMarker.reset(); } ScDrawView::~ScDrawView() @@ -907,7 +903,7 @@ void ScDrawView::MarkDropObj( SdrObject* pObj ) if(pDropMarkObj) { - pDropMarker = new SdrDropMarkerOverlay(*this, *pDropMarkObj); + pDropMarker.reset( new SdrDropMarkerOverlay(*this, *pDropMarkObj) ); } } } |