[Libreoffice-commits] core.git: include/unotools unotools/source
Xisco Fauli
anistenis at gmail.com
Mon Jun 6 07:19:06 UTC 2016
include/unotools/accessiblestatesethelper.hxx | 3 ++-
unotools/source/accessibility/accessiblestatesethelper.cxx | 12 ++++--------
2 files changed, 6 insertions(+), 9 deletions(-)
New commits:
commit c9ff3efd2cc1a0bcf09b073972ecf21b244f9fd8
Author: Xisco Fauli <anistenis at gmail.com>
Date: Sat Jun 4 23:07:09 2016 +0200
tdf#89329: use unique_ptr for pImpl in accessiblestatesethelper
Change-Id: I768bfd5a19a2633e6d6cd37f919c20cbfc76824e
Reviewed-on: https://gerrit.libreoffice.org/25905
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin at gmail.com>
diff --git a/include/unotools/accessiblestatesethelper.hxx b/include/unotools/accessiblestatesethelper.hxx
index f880302..86d4950 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 1608b97..aa9e8a7 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 ==============================================
More information about the Libreoffice-commits
mailing list