diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-20 15:14:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-21 08:20:26 +0200 |
commit | 517c070d0642756fcef58214385407af603e22b6 (patch) | |
tree | 8768f9439538c73540f2cf9e0b5d004db72a2201 /forms | |
parent | 4c93de2c921b43193985c057b03e329d6dddc5d4 (diff) |
loplugin:useuniqueptr in frm::AttributeState
Change-Id: I48e8285a1c3a029e69371e5ba9f936e4517b6db3
Reviewed-on: https://gerrit.libreoffice.org/56185
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/richtext/rtattributes.hxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/forms/source/richtext/rtattributes.hxx b/forms/source/richtext/rtattributes.hxx index 6f79286f653f..6c166b240bbf 100644 --- a/forms/source/richtext/rtattributes.hxx +++ b/forms/source/richtext/rtattributes.hxx @@ -43,7 +43,7 @@ namespace frm struct AttributeState { private: - SfxPoolItem *pItemHandleItem; + std::unique_ptr<SfxPoolItem> pItemHandleItem; public: AttributeCheckState eSimpleState; @@ -91,17 +91,15 @@ namespace frm inline const SfxPoolItem* AttributeState::getItem() const { - return pItemHandleItem; + return pItemHandleItem.get(); } inline void AttributeState::setItem( const SfxPoolItem* _pItem ) { - if ( pItemHandleItem ) - delete pItemHandleItem; if ( _pItem ) - pItemHandleItem = _pItem->Clone(); + pItemHandleItem.reset(_pItem->Clone()); else - pItemHandleItem = nullptr; + pItemHandleItem.reset(); } inline bool AttributeState::operator==( const AttributeState& _rRHS ) |