diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-02-15 20:54:22 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-02-16 12:54:45 +0000 |
commit | 01a8bda416d1598f5486f95b6a57d61ff09873ed (patch) | |
tree | c37934d13308426d22599f63bf8666305a6b1f80 /comphelper | |
parent | a1ceacc17e3f30d5e9c06b3218ad8ec26ca2f1b9 (diff) |
boost::noncopyable->'= delete'
Change-Id: If0f898a1e912fcd2095d8ba88b2b8046596e16ea
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/inc/pch/precompiled_comphelper.hxx | 1 | ||||
-rw-r--r-- | comphelper/source/property/ChainablePropertySet.cxx | 18 | ||||
-rw-r--r-- | comphelper/source/property/MasterPropertySet.cxx | 48 |
3 files changed, 32 insertions, 35 deletions
diff --git a/comphelper/inc/pch/precompiled_comphelper.hxx b/comphelper/inc/pch/precompiled_comphelper.hxx index 7b83f16bf8fb..63497211d0f9 100644 --- a/comphelper/inc/pch/precompiled_comphelper.hxx +++ b/comphelper/inc/pch/precompiled_comphelper.hxx @@ -20,7 +20,6 @@ #include <boost/current_function.hpp> #include <boost/noncopyable.hpp> #include <boost/scoped_array.hpp> -#include <boost/scoped_ptr.hpp> #include <boost/shared_ptr.hpp> #include <cassert> #include <com/sun/star/accessibility/AccessibleEventId.hpp> diff --git a/comphelper/source/property/ChainablePropertySet.cxx b/comphelper/source/property/ChainablePropertySet.cxx index 4c66d8c86ad3..af36f0ce2170 100644 --- a/comphelper/source/property/ChainablePropertySet.cxx +++ b/comphelper/source/property/ChainablePropertySet.cxx @@ -23,7 +23,7 @@ #include <osl/diagnose.h> -#include <boost/scoped_ptr.hpp> +#include <memory> using namespace ::comphelper; using namespace ::com::sun::star; @@ -55,9 +55,9 @@ void SAL_CALL ChainablePropertySet::setPropertyValue( const OUString& rPropertyN throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException, std::exception) { // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard; + std::unique_ptr< osl::Guard< comphelper::SolarMutex > > xMutexGuard; if (mpMutex) - pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); + xMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); PropertyInfoHash::const_iterator aIter = mpInfo->maMap.find ( rPropertyName ); @@ -73,9 +73,9 @@ Any SAL_CALL ChainablePropertySet::getPropertyValue( const OUString& rPropertyNa throw(UnknownPropertyException, WrappedTargetException, RuntimeException, std::exception) { // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard; + std::unique_ptr< osl::Guard< comphelper::SolarMutex > > xMutexGuard; if (mpMutex) - pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); + xMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); PropertyInfoHash::const_iterator aIter = mpInfo->maMap.find ( rPropertyName ); @@ -120,9 +120,9 @@ void SAL_CALL ChainablePropertySet::setPropertyValues(const Sequence< OUString > WrappedTargetException, RuntimeException, std::exception) { // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard; + std::unique_ptr< osl::Guard< comphelper::SolarMutex > > xMutexGuard; if (mpMutex) - pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); + xMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); const sal_Int32 nCount = rPropertyNames.getLength(); @@ -154,9 +154,9 @@ Sequence< Any > SAL_CALL ChainablePropertySet::getPropertyValues(const Sequence< throw (RuntimeException, std::exception) { // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard; + std::unique_ptr< osl::Guard< comphelper::SolarMutex > > xMutexGuard; if (mpMutex) - pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); + xMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); const sal_Int32 nCount = rPropertyNames.getLength(); diff --git a/comphelper/source/property/MasterPropertySet.cxx b/comphelper/source/property/MasterPropertySet.cxx index 5ba477a43785..8c5a220a0bec 100644 --- a/comphelper/source/property/MasterPropertySet.cxx +++ b/comphelper/source/property/MasterPropertySet.cxx @@ -26,28 +26,26 @@ #include <osl/diagnose.h> -#include <boost/scoped_ptr.hpp> - - +#include <memory> class AutoOGuardArray { - boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > * mpGuardArray; + std::unique_ptr< osl::Guard< comphelper::SolarMutex > > * mpGuardArray; public: AutoOGuardArray( sal_Int32 nNumElements ); ~AutoOGuardArray(); - boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > & operator[] ( sal_Int32 i ) { return mpGuardArray[i]; } + std::unique_ptr< osl::Guard< comphelper::SolarMutex > > & operator[] ( sal_Int32 i ) { return mpGuardArray[i]; } }; -AutoOGuardArray::AutoOGuardArray( sal_Int32 nNumElements ) : mpGuardArray(new boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > >[nNumElements]) +AutoOGuardArray::AutoOGuardArray( sal_Int32 nNumElements ) : mpGuardArray(new std::unique_ptr< osl::Guard< comphelper::SolarMutex > >[nNumElements]) { } AutoOGuardArray::~AutoOGuardArray() { - //!! release scoped_ptr's and thus the mutexes locks + //!! release unique_ptr's and thus the mutexes locks delete [] mpGuardArray; } @@ -106,9 +104,9 @@ void SAL_CALL MasterPropertySet::setPropertyValue( const OUString& rPropertyName throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException, std::exception) { // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard; + std::unique_ptr< osl::Guard< comphelper::SolarMutex > > xMutexGuard; if (mpMutex) - pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); + xMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); PropertyDataHash::const_iterator aIter = mpInfo->maMap.find ( rPropertyName ); @@ -126,9 +124,9 @@ void SAL_CALL MasterPropertySet::setPropertyValue( const OUString& rPropertyName ChainablePropertySet * pSlave = maSlaveMap [ (*aIter).second->mnMapId ]->mpSlave; // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard2; + std::unique_ptr< osl::Guard< comphelper::SolarMutex > > xMutexGuard2; if (pSlave->mpMutex) - pMutexGuard2.reset( new osl::Guard< comphelper::SolarMutex >(pSlave->mpMutex) ); + xMutexGuard2.reset( new osl::Guard< comphelper::SolarMutex >(pSlave->mpMutex) ); pSlave->_preSetValues(); pSlave->_setSingleValue( *((*aIter).second->mpInfo), rValue ); @@ -140,9 +138,9 @@ Any SAL_CALL MasterPropertySet::getPropertyValue( const OUString& rPropertyName throw(UnknownPropertyException, WrappedTargetException, RuntimeException, std::exception) { // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard; + std::unique_ptr< osl::Guard< comphelper::SolarMutex > > xMutexGuard; if (mpMutex) - pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); + xMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); PropertyDataHash::const_iterator aIter = mpInfo->maMap.find ( rPropertyName ); @@ -161,9 +159,9 @@ Any SAL_CALL MasterPropertySet::getPropertyValue( const OUString& rPropertyName ChainablePropertySet * pSlave = maSlaveMap [ (*aIter).second->mnMapId ]->mpSlave; // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard2; + std::unique_ptr< osl::Guard< comphelper::SolarMutex > > xMutexGuard2; if (pSlave->mpMutex) - pMutexGuard2.reset( new osl::Guard< comphelper::SolarMutex >(pSlave->mpMutex) ); + xMutexGuard2.reset( new osl::Guard< comphelper::SolarMutex >(pSlave->mpMutex) ); pSlave->_preGetValues(); pSlave->_getSingleValue( *((*aIter).second->mpInfo), aAny ); @@ -201,9 +199,9 @@ void SAL_CALL MasterPropertySet::setPropertyValues( const Sequence< OUString >& throw(PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException, std::exception) { // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard; + std::unique_ptr< osl::Guard< comphelper::SolarMutex > > xMutexGuard; if (mpMutex) - pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); + xMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); const sal_Int32 nCount = aPropertyNames.getLength(); @@ -218,9 +216,9 @@ void SAL_CALL MasterPropertySet::setPropertyValues( const Sequence< OUString >& const OUString * pString = aPropertyNames.getConstArray(); PropertyDataHash::const_iterator aEnd = mpInfo->maMap.end(), aIter; - //!! have a scoped_ptr to an array of OGuards in order to have the + //!! have a unique_ptr to an array of OGuards in order to have the //!! allocated memory properly freed (exception safe!). - //!! Since the array itself has scoped_ptrs as members we have to use a + //!! Since the array itself has unique_ptrs as members we have to use a //!! helper class 'AutoOGuardArray' in order to have //!! the acquired locks properly released. AutoOGuardArray aOGuardArray( nCount ); @@ -267,9 +265,9 @@ Sequence< Any > SAL_CALL MasterPropertySet::getPropertyValues( const Sequence< O throw(RuntimeException, std::exception) { // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard; + std::unique_ptr< osl::Guard< comphelper::SolarMutex > > xMutexGuard; if (mpMutex) - pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); + xMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(mpMutex) ); const sal_Int32 nCount = aPropertyNames.getLength(); @@ -283,9 +281,9 @@ Sequence< Any > SAL_CALL MasterPropertySet::getPropertyValues( const Sequence< O const OUString * pString = aPropertyNames.getConstArray(); PropertyDataHash::const_iterator aEnd = mpInfo->maMap.end(), aIter; - //!! have an scoped_ptr to an array of OGuards in order to have the + //!! have an unique_ptr to an array of OGuards in order to have the //!! allocated memory properly freed (exception safe!). - //!! Since the array itself has scoped_ptrs as members we have to use a + //!! Since the array itself has unique_ptrs as members we have to use a //!! helper class 'AutoOGuardArray' in order to have //!! the acquired locks properly released. AutoOGuardArray aOGuardArray( nCount ); @@ -368,9 +366,9 @@ PropertyState SAL_CALL MasterPropertySet::getPropertyState( const OUString& Prop ChainablePropertySet * pSlave = maSlaveMap [ (*aIter).second->mnMapId ]->mpSlave; // acquire mutex in c-tor and releases it in the d-tor (exception safe!). - boost::scoped_ptr< osl::Guard< comphelper::SolarMutex > > pMutexGuard; + std::unique_ptr< osl::Guard< comphelper::SolarMutex > > xMutexGuard; if (pSlave->mpMutex) - pMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(pSlave->mpMutex) ); + xMutexGuard.reset( new osl::Guard< comphelper::SolarMutex >(pSlave->mpMutex) ); pSlave->_preGetPropertyState(); pSlave->_getPropertyState( *((*aIter).second->mpInfo), aState ); |