diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-09-15 14:46:08 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-09-15 17:01:56 +0100 |
commit | 1b69a16689bb87ec9c9db66f4e154aca79085edb (patch) | |
tree | e690fc8556cec1bab8283183fd1d31eaedbb87d0 /comphelper | |
parent | 31526bc15e409fb3260b465d928ddcb855266278 (diff) |
boost::scoped_ptr is sufficient here
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/property/ChainablePropertySet.cxx | 10 | ||||
-rw-r--r-- | comphelper/source/property/MasterPropertySet.cxx | 22 |
2 files changed, 16 insertions, 16 deletions
diff --git a/comphelper/source/property/ChainablePropertySet.cxx b/comphelper/source/property/ChainablePropertySet.cxx index e3a02dce4c1b..2519b8f5edb8 100644 --- a/comphelper/source/property/ChainablePropertySet.cxx +++ b/comphelper/source/property/ChainablePropertySet.cxx @@ -32,7 +32,7 @@ #include <comphelper/ChainablePropertySetInfo.hxx> #include <osl/mutex.hxx> -#include <memory> // STL auto_ptr +#include <boost/scoped_ptr.hpp> using namespace ::rtl; @@ -78,7 +78,7 @@ void SAL_CALL ChainablePropertySet::setPropertyValue( const ::rtl::OUString& rPr throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - std::auto_ptr< osl::SolarGuard > pMutexGuard; + boost::scoped_ptr< osl::SolarGuard > pMutexGuard; if (mpMutex) pMutexGuard.reset( new osl::SolarGuard(mpMutex) ); @@ -96,7 +96,7 @@ Any SAL_CALL ChainablePropertySet::getPropertyValue( const ::rtl::OUString& rPro throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - std::auto_ptr< osl::SolarGuard > pMutexGuard; + boost::scoped_ptr< osl::SolarGuard > pMutexGuard; if (mpMutex) pMutexGuard.reset( new osl::SolarGuard(mpMutex) ); @@ -142,7 +142,7 @@ void SAL_CALL ChainablePropertySet::setPropertyValues( const Sequence< ::rtl::OU throw(PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - std::auto_ptr< osl::SolarGuard > pMutexGuard; + boost::scoped_ptr< osl::SolarGuard > pMutexGuard; if (mpMutex) pMutexGuard.reset( new osl::SolarGuard(mpMutex) ); @@ -176,7 +176,7 @@ Sequence< Any > SAL_CALL ChainablePropertySet::getPropertyValues( const Sequence throw(RuntimeException) { // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - std::auto_ptr< osl::SolarGuard > pMutexGuard; + boost::scoped_ptr< osl::SolarGuard > pMutexGuard; if (mpMutex) pMutexGuard.reset( new osl::SolarGuard(mpMutex) ); diff --git a/comphelper/source/property/MasterPropertySet.cxx b/comphelper/source/property/MasterPropertySet.cxx index 78f33af7aed0..fa44c874adf7 100644 --- a/comphelper/source/property/MasterPropertySet.cxx +++ b/comphelper/source/property/MasterPropertySet.cxx @@ -35,26 +35,26 @@ #include <comphelper/ChainablePropertySetInfo.hxx> #include <osl/mutex.hxx> -#include <memory> // STL auto_ptr +#include <boost/scoped_ptr.hpp> ////////////////////////////////////////////////////////////////////// class AutoOGuardArray { sal_Int32 nSize; - std::auto_ptr< osl::SolarGuard > * pGuardArray; + boost::scoped_ptr< osl::SolarGuard > * pGuardArray; public: AutoOGuardArray( sal_Int32 nNumElements ); ~AutoOGuardArray(); - std::auto_ptr< osl::SolarGuard > & operator[] ( sal_Int32 i ) { return pGuardArray[i]; } + boost::scoped_ptr< osl::SolarGuard > & operator[] ( sal_Int32 i ) { return pGuardArray[i]; } }; AutoOGuardArray::AutoOGuardArray( sal_Int32 nNumElements ) { nSize = nNumElements; - pGuardArray = new std::auto_ptr< osl::SolarGuard >[ nSize ]; + pGuardArray = new boost::scoped_ptr< osl::SolarGuard >[ nSize ]; } AutoOGuardArray::~AutoOGuardArray() @@ -130,7 +130,7 @@ void SAL_CALL MasterPropertySet::setPropertyValue( const ::rtl::OUString& rPrope throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - std::auto_ptr< osl::SolarGuard > pMutexGuard; + boost::scoped_ptr< osl::SolarGuard > pMutexGuard; if (mpMutex) pMutexGuard.reset( new osl::SolarGuard(mpMutex) ); @@ -150,7 +150,7 @@ void SAL_CALL MasterPropertySet::setPropertyValue( const ::rtl::OUString& rPrope ChainablePropertySet * pSlave = maSlaveMap [ (*aIter).second->mnMapId ]->mpSlave; // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - std::auto_ptr< osl::SolarGuard > pMutexGuard2; + boost::scoped_ptr< osl::SolarGuard > pMutexGuard2; if (pSlave->mpMutex) pMutexGuard2.reset( new osl::SolarGuard(pSlave->mpMutex) ); @@ -164,7 +164,7 @@ Any SAL_CALL MasterPropertySet::getPropertyValue( const ::rtl::OUString& rProper throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - std::auto_ptr< osl::SolarGuard > pMutexGuard; + boost::scoped_ptr< osl::SolarGuard > pMutexGuard; if (mpMutex) pMutexGuard.reset( new osl::SolarGuard(mpMutex) ); @@ -185,7 +185,7 @@ Any SAL_CALL MasterPropertySet::getPropertyValue( const ::rtl::OUString& rProper ChainablePropertySet * pSlave = maSlaveMap [ (*aIter).second->mnMapId ]->mpSlave; // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - std::auto_ptr< osl::SolarGuard > pMutexGuard2; + boost::scoped_ptr< osl::SolarGuard > pMutexGuard2; if (pSlave->mpMutex) pMutexGuard2.reset( new osl::SolarGuard(pSlave->mpMutex) ); @@ -225,7 +225,7 @@ void SAL_CALL MasterPropertySet::setPropertyValues( const Sequence< ::rtl::OUStr throw(PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - std::auto_ptr< osl::SolarGuard > pMutexGuard; + boost::scoped_ptr< osl::SolarGuard > pMutexGuard; if (mpMutex) pMutexGuard.reset( new osl::SolarGuard(mpMutex) ); @@ -291,7 +291,7 @@ Sequence< Any > SAL_CALL MasterPropertySet::getPropertyValues( const Sequence< : throw(RuntimeException) { // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - std::auto_ptr< osl::SolarGuard > pMutexGuard; + boost::scoped_ptr< osl::SolarGuard > pMutexGuard; if (mpMutex) pMutexGuard.reset( new osl::SolarGuard(mpMutex) ); @@ -392,7 +392,7 @@ PropertyState SAL_CALL MasterPropertySet::getPropertyState( const ::rtl::OUStrin ChainablePropertySet * pSlave = maSlaveMap [ (*aIter).second->mnMapId ]->mpSlave; // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - std::auto_ptr< osl::SolarGuard > pMutexGuard; + boost::scoped_ptr< osl::SolarGuard > pMutexGuard; if (pSlave->mpMutex) pMutexGuard.reset( new osl::SolarGuard(pSlave->mpMutex) ); |