From 8b7434bc04de343b47d3107995cd9c3c96de40b0 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 5 Sep 2019 16:46:13 +0200 Subject: use unique_ptr in SdrObject::getFullDragClone Change-Id: I904f1f13bb4958e3457476e6e682ec7d7b97c670 Reviewed-on: https://gerrit.libreoffice.org/78660 Tested-by: Jenkins Reviewed-by: Noel Grandin --- basctl/source/dlged/dlgedobj.cxx | 6 +++--- basctl/source/inc/dlgedobj.hxx | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'basctl') diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx index 0d491bd303e0..80bf91698928 100644 --- a/basctl/source/dlged/dlgedobj.cxx +++ b/basctl/source/dlged/dlgedobj.cxx @@ -914,13 +914,13 @@ DlgEdObj* DlgEdObj::CloneSdrObject(SdrModel& rTargetModel) const return pDlgEdObj; } -SdrObject* DlgEdObj::getFullDragClone() const +SdrObjectUniquePtr DlgEdObj::getFullDragClone() const { // no need to really add the clone for dragging, it's a temporary // object - SdrObject* pObj = new SdrUnoObj( + SdrObjectUniquePtr pObj( new SdrUnoObj( getSdrModelFromSdrObject(), - OUString()); + OUString()) ); *pObj = *static_cast(this); return pObj; diff --git a/basctl/source/inc/dlgedobj.hxx b/basctl/source/inc/dlgedobj.hxx index 5a1f6c25ce43..8442747bce78 100644 --- a/basctl/source/inc/dlgedobj.hxx +++ b/basctl/source/inc/dlgedobj.hxx @@ -107,7 +107,7 @@ public: void clonedFrom(const DlgEdObj* _pSource); // not working yet // FullDrag support - virtual SdrObject* getFullDragClone() const override; + virtual SdrObjectUniquePtr getFullDragClone() const override; bool supportsService( OUString const & serviceName ) const; OUString GetDefaultName() const; -- cgit