summaryrefslogtreecommitdiff
path: root/include/svl/poolitem.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-10-25 12:21:25 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-25 14:25:30 +0200
commitd4dff7dc148080da437ed2e46cd08ded044e64a7 (patch)
treec204d3300167fc79a7ed09fece246ec28840f8c9 /include/svl/poolitem.hxx
parentdd16804e52984ded1ee739a22822daa068a13707 (diff)
return std::unique_ptr from CloneSetWhich
Change-Id: I709122cb8cd7c257e7eb2bd564c529689e6d555a Reviewed-on: https://gerrit.libreoffice.org/62350 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/svl/poolitem.hxx')
-rw-r--r--include/svl/poolitem.hxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx
index 25a5a83a2d05..6964f776c63d 100644
--- a/include/svl/poolitem.hxx
+++ b/include/svl/poolitem.hxx
@@ -173,10 +173,10 @@ public:
virtual SvStream& Store( SvStream &, sal_uInt16 nItemVersion ) const;
virtual SfxPoolItem* Clone( SfxItemPool *pPool = nullptr ) const = 0;
// clone and call SetWhich
- SfxPoolItem* CloneSetWhich( sal_uInt16 nNewWhich ) const;
- template<class T> T* CloneSetWhich( TypedWhichId<T> nId ) const
+ std::unique_ptr<SfxPoolItem> CloneSetWhich( sal_uInt16 nNewWhich ) const;
+ template<class T> std::unique_ptr<T> CloneSetWhich( TypedWhichId<T> nId ) const
{
- return static_cast<T*>(CloneSetWhich(sal_uInt16(nId)));
+ return std::unique_ptr<T>(static_cast<T*>(CloneSetWhich(sal_uInt16(nId)).release()));
}
sal_uInt32 GetRefCount() const { return m_nRefCount; }