diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-12 15:07:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-13 09:17:34 +0200 |
commit | 0fdcfedd898afcc03332a432ef21052eee6b3a3a (patch) | |
tree | 46ed1c968570414ffa0917d2324863234cc504fe /include/svx | |
parent | d0d4a3647692883b17a1acd96a01a1857c5872b1 (diff) |
make SdrObjUserData::Clone return std::unique_ptr
Change-Id: Iffe047b081fde0bb582d8730a8e96d2597c7567a
Reviewed-on: https://gerrit.libreoffice.org/52780
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/galmisc.hxx | 4 | ||||
-rw-r--r-- | include/svx/svdobj.hxx | 4 | ||||
-rw-r--r-- | include/svx/svdotext.hxx | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/include/svx/galmisc.hxx b/include/svx/galmisc.hxx index dd2aea3c5a16..5605c8a093f0 100644 --- a/include/svx/galmisc.hxx +++ b/include/svx/galmisc.hxx @@ -105,11 +105,11 @@ public: SdrObjUserData( SdrInventor::SgaImap, ID_IMAPINFO ), aImageMap( rImageMap ) {}; - virtual SdrObjUserData* Clone( SdrObject* ) const override + virtual std::unique_ptr<SdrObjUserData> Clone( SdrObject* ) const override { SgaIMapInfo* pInfo = new SgaIMapInfo; pInfo->aImageMap = aImageMap; - return pInfo; + return std::unique_ptr<SdrObjUserData>(pInfo); } const ImageMap& GetImageMap() const { return aImageMap; } diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 7d033605933a..6cf9336ea014 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -213,7 +213,7 @@ public: SdrObjUserData(const SdrObjUserData& rData); virtual ~SdrObjUserData(); - virtual SdrObjUserData* Clone(SdrObject* pObj1) const = 0; // #i71039# NULL -> 0 + virtual std::unique_ptr<SdrObjUserData> Clone(SdrObject* pObj1) const = 0; // #i71039# NULL -> 0 SdrInventor GetInventor() const { return nInventor;} sal_uInt16 GetId() const { return nIdentifier;} }; @@ -803,7 +803,7 @@ public: sal_uInt16 GetUserDataCount() const; SdrObjUserData* GetUserData(sal_uInt16 nNum) const; - void AppendUserData(SdrObjUserData* pData); + void AppendUserData(std::unique_ptr<SdrObjUserData> pData); // removes the record from the list and performs delete (FreeMem+Dtor). void DeleteUserData(sal_uInt16 nNum); diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index 13ff8940d0c1..b285d8bece72 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -116,7 +116,7 @@ public: ImpSdrObjTextLinkUserData(); virtual ~ImpSdrObjTextLinkUserData() override; - virtual SdrObjUserData* Clone(SdrObject* pObj1) const override; + virtual std::unique_ptr<SdrObjUserData> Clone(SdrObject* pObj1) const override; }; namespace sdr |