diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-18 15:58:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-05-19 10:45:45 +0200 |
commit | c0ee80f9787bc5e86fb7a342b567c0649253e1e3 (patch) | |
tree | f44505ae8df20982349485c47370f7271195866e /include/svx | |
parent | aca5e1ba7f33c8913304b5f90ef478f316e64263 (diff) |
loplugin:useuniqueptr in SdrDragView
and fix potential leak on early return in SdrDragView::BegDragObj
Change-Id: I707be6e2c7dc2c251f37447fe3cd98c4b50b59d1
Reviewed-on: https://gerrit.libreoffice.org/53751
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svx')
-rw-r--r-- | include/svx/svddrgv.hxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/svx/svddrgv.hxx b/include/svx/svddrgv.hxx index 180d8cc09269..5fbb65c9dee7 100644 --- a/include/svx/svddrgv.hxx +++ b/include/svx/svddrgv.hxx @@ -22,6 +22,7 @@ #include <svx/svxdllapi.h> #include <svx/svdxcgv.hxx> +#include <memory> class SdrUndoGeoObj; @@ -38,7 +39,7 @@ class SVX_DLLPUBLIC SdrDragView : public SdrExchangeView protected: SdrHdl* mpDragHdl; - SdrDragMethod* mpCurrentSdrDragMethod; + std::unique_ptr<SdrDragMethod> mpCurrentSdrDragMethod; SdrUndoGeoObj* mpInsPointUndo; tools::Rectangle maDragLimit; OUString maInsPointUndoStr; @@ -104,7 +105,7 @@ public: void BrkDragObj(); bool IsDragObj() const { return mpCurrentSdrDragMethod && !mbInsPolyPoint && !mbInsGluePoint; } SdrHdl* GetDragHdl() const { return mpDragHdl; } - SdrDragMethod* GetDragMethod() const { return mpCurrentSdrDragMethod; } + SdrDragMethod* GetDragMethod() const { return mpCurrentSdrDragMethod.get(); } bool IsDraggingPoints() const { return meDragHdl==SdrHdlKind::Poly; } bool IsDraggingGluePoints() const { return meDragHdl==SdrHdlKind::Glue; } |