From d7515f60dc0ebb54fb2db7de46b3579963698e6a Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sat, 15 Sep 2012 15:16:04 +0200 Subject: [PATCH] Simplify AutoOGuardArray + rename private attribute Change-Id: I9d651303fb80ef5c81d608e56a87cb9548c13f8f --- comphelper/source/property/MasterPropertySet.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/comphelper/source/property/MasterPropertySet.cxx b/comphelper/source/property/MasterPropertySet.cxx index 1f353cc3f4f6..1cc524b95a88 100644 --- a/comphelper/source/property/MasterPropertySet.cxx +++ b/comphelper/source/property/MasterPropertySet.cxx @@ -30,26 +30,23 @@ class AutoOGuardArray { - sal_Int32 nSize; - boost::scoped_ptr< osl::SolarGuard > * pGuardArray; + boost::scoped_ptr< osl::SolarGuard > * mpGuardArray; public: AutoOGuardArray( sal_Int32 nNumElements ); ~AutoOGuardArray(); - boost::scoped_ptr< osl::SolarGuard > & operator[] ( sal_Int32 i ) { return pGuardArray[i]; } + boost::scoped_ptr< osl::SolarGuard > & operator[] ( sal_Int32 i ) { return mpGuardArray[i]; } }; -AutoOGuardArray::AutoOGuardArray( sal_Int32 nNumElements ) +AutoOGuardArray::AutoOGuardArray( sal_Int32 nNumElements ) : mpGuardArray(new boost::scoped_ptr< osl::SolarGuard >[nNumElements]) { - nSize = nNumElements; - pGuardArray = new boost::scoped_ptr< osl::SolarGuard >[ nSize ]; } AutoOGuardArray::~AutoOGuardArray() { //!! release auto_ptr's and thus the mutexes locks - delete [] pGuardArray; + delete [] mpGuardArray; }