diff options
author | Xisco Fauli <anistenis@gmail.com> | 2016-06-04 23:03:57 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-06-06 07:10:58 +0000 |
commit | 353e5ea62ed6a273a3856bd1e3cb4d2380804e83 (patch) | |
tree | b313fa7b2980ace1281370bdf5b0b016766f5fc5 | |
parent | 82407c651ee8b5d8876d4a1f76898de33c69e232 (diff) |
tdf#89329: use unique_ptr for pImpl in accessiblerelationsethelper
Change-Id: I29578afa206e869a5b2e6fb42c7f5ebf4a6f2fe8
Reviewed-on: https://gerrit.libreoffice.org/25906
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | include/unotools/accessiblerelationsethelper.hxx | 3 | ||||
-rw-r--r-- | unotools/source/accessibility/accessiblerelationsethelper.cxx | 9 |
2 files changed, 5 insertions, 7 deletions
diff --git a/include/unotools/accessiblerelationsethelper.hxx b/include/unotools/accessiblerelationsethelper.hxx index 538d6cddfb94..f2a9f9793861 100644 --- a/include/unotools/accessiblerelationsethelper.hxx +++ b/include/unotools/accessiblerelationsethelper.hxx @@ -30,6 +30,7 @@ #include <osl/mutex.hxx> #include <cppuhelper/implbase1.hxx> #include <comphelper/servicehelper.hxx> +#include <memory> class AccessibleRelationSetHelperImpl; @@ -136,7 +137,7 @@ protected: private: /// The implementation of this helper interface. - AccessibleRelationSetHelperImpl* mpHelperImpl; + std::unique_ptr<AccessibleRelationSetHelperImpl> mpHelperImpl; }; } diff --git a/unotools/source/accessibility/accessiblerelationsethelper.cxx b/unotools/source/accessibility/accessiblerelationsethelper.cxx index 726943ce98b7..0c62e6ccfdf5 100644 --- a/unotools/source/accessibility/accessiblerelationsethelper.cxx +++ b/unotools/source/accessibility/accessiblerelationsethelper.cxx @@ -123,24 +123,21 @@ void AccessibleRelationSetHelperImpl::AddRelation(const AccessibleRelation& rRel //===== internal ============================================================ AccessibleRelationSetHelper::AccessibleRelationSetHelper () - : mpHelperImpl(nullptr) + : mpHelperImpl(new AccessibleRelationSetHelperImpl) { - mpHelperImpl = new AccessibleRelationSetHelperImpl(); } AccessibleRelationSetHelper::AccessibleRelationSetHelper (const AccessibleRelationSetHelper& rHelper) : cppu::WeakImplHelper1<XAccessibleRelationSet>() - , mpHelperImpl(nullptr) { if (rHelper.mpHelperImpl) - mpHelperImpl = new AccessibleRelationSetHelperImpl(*rHelper.mpHelperImpl); + mpHelperImpl.reset(new AccessibleRelationSetHelperImpl(*rHelper.mpHelperImpl)); else - mpHelperImpl = new AccessibleRelationSetHelperImpl(); + mpHelperImpl.reset(new AccessibleRelationSetHelperImpl()); } AccessibleRelationSetHelper::~AccessibleRelationSetHelper() { - delete mpHelperImpl; } //===== XAccessibleRelationSet ============================================== |