diff options
author | Xisco Fauli <anistenis@gmail.com> | 2016-06-04 23:07:09 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-06-06 07:18:44 +0000 |
commit | c9ff3efd2cc1a0bcf09b073972ecf21b244f9fd8 (patch) | |
tree | d708fb31792c34545958c88d586ead6f4d086f14 | |
parent | 52af06b471ed3e4627be3950330ad311b71c275b (diff) |
tdf#89329: use unique_ptr for pImpl in accessiblestatesethelper
Change-Id: I768bfd5a19a2633e6d6cd37f919c20cbfc76824e
Reviewed-on: https://gerrit.libreoffice.org/25905
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | include/unotools/accessiblestatesethelper.hxx | 3 | ||||
-rw-r--r-- | unotools/source/accessibility/accessiblestatesethelper.cxx | 12 |
2 files changed, 6 insertions, 9 deletions
diff --git a/include/unotools/accessiblestatesethelper.hxx b/include/unotools/accessiblestatesethelper.hxx index f8803026f264..86d49508ac50 100644 --- a/include/unotools/accessiblestatesethelper.hxx +++ b/include/unotools/accessiblestatesethelper.hxx @@ -29,6 +29,7 @@ #include <osl/mutex.hxx> #include <cppuhelper/implbase1.hxx> #include <comphelper/servicehelper.hxx> +#include <memory> class AccessibleStateSetHelperImpl; @@ -144,7 +145,7 @@ protected: private: /// The implementation of this helper interface. - AccessibleStateSetHelperImpl* mpHelperImpl; + std::unique_ptr<AccessibleStateSetHelperImpl> mpHelperImpl; }; } diff --git a/unotools/source/accessibility/accessiblestatesethelper.cxx b/unotools/source/accessibility/accessiblestatesethelper.cxx index 1608b9743da5..aa9e8a756adf 100644 --- a/unotools/source/accessibility/accessiblestatesethelper.cxx +++ b/unotools/source/accessibility/accessiblestatesethelper.cxx @@ -126,31 +126,27 @@ inline void AccessibleStateSetHelperImpl::RemoveState(sal_Int16 aState) //===== internal ============================================================ AccessibleStateSetHelper::AccessibleStateSetHelper () - : mpHelperImpl(nullptr) + : mpHelperImpl(new AccessibleStateSetHelperImpl) { - mpHelperImpl = new AccessibleStateSetHelperImpl(); } AccessibleStateSetHelper::AccessibleStateSetHelper ( const sal_Int64 _nInitialStates ) - : mpHelperImpl(nullptr) + : mpHelperImpl(new AccessibleStateSetHelperImpl) { - mpHelperImpl = new AccessibleStateSetHelperImpl(); mpHelperImpl->AddStates( _nInitialStates ); } AccessibleStateSetHelper::AccessibleStateSetHelper (const AccessibleStateSetHelper& rHelper) : cppu::WeakImplHelper1<XAccessibleStateSet>() - , mpHelperImpl(nullptr) { if (rHelper.mpHelperImpl) - mpHelperImpl = new AccessibleStateSetHelperImpl(*rHelper.mpHelperImpl); + mpHelperImpl.reset(new AccessibleStateSetHelperImpl(*rHelper.mpHelperImpl)); else - mpHelperImpl = new AccessibleStateSetHelperImpl(); + mpHelperImpl.reset(new AccessibleStateSetHelperImpl()); } AccessibleStateSetHelper::~AccessibleStateSetHelper() { - delete mpHelperImpl; } //===== XAccessibleStateSet ============================================== |