summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-09-24 17:48:49 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-09-25 08:40:11 +0200
commitc91dec0dad6b0da5bfe15d0597bfc069df26f343 (patch)
treeaf3f075afff656995fd34ac6771f2fe2fe2df77a /comphelper
parent5de8a127cd1790d37d5af83153b8103468eca6ce (diff)
comphelper: std::auto_ptr -> std::unique_ptr
Change-Id: I364d6252f470dcc6d71a191f1249e95ca1f284ce
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/container/enumerablemap.cxx15
-rw-r--r--comphelper/source/misc/anycompare.cxx6
-rw-r--r--comphelper/source/property/MasterPropertySet.cxx10
-rw-r--r--comphelper/source/property/opropertybag.hxx2
4 files changed, 16 insertions, 17 deletions
diff --git a/comphelper/source/container/enumerablemap.cxx b/comphelper/source/container/enumerablemap.cxx
index 7dc2df10c93e..763e31f6ff50 100644
--- a/comphelper/source/container/enumerablemap.cxx
+++ b/comphelper/source/container/enumerablemap.cxx
@@ -39,9 +39,10 @@
#include <typelib/typedescription.hxx>
#include <map>
-#include <boost/noncopyable.hpp>
-#include <boost/shared_ptr.hpp>
+#include <memory>
+#include <utility>
+#include <boost/noncopyable.hpp>
namespace comphelper
{
@@ -93,8 +94,8 @@ namespace comphelper
{
Type m_aKeyType;
Type m_aValueType;
- ::std::auto_ptr< KeyedValues > m_pValues;
- ::boost::shared_ptr< IKeyPredicateLess > m_pKeyCompare;
+ ::std::unique_ptr< KeyedValues > m_pValues;
+ ::std::shared_ptr< IKeyPredicateLess > m_pKeyCompare;
bool m_bMutable;
MapListeners m_aModListeners;
@@ -333,7 +334,7 @@ namespace comphelper
private:
// since we share our mutex with the main map, we need to keep it alive as long as we live
Reference< XInterface > m_xKeepMapAlive;
- ::std::auto_ptr< MapData > m_pMapDataCopy;
+ ::std::unique_ptr< MapData > m_pMapDataCopy;
MapEnumerator m_aEnumerator;
};
@@ -388,14 +389,14 @@ namespace comphelper
throw IllegalTypeException("Unsupported value type.", *this );
// create the comparator for the KeyType, and throw if the type is not supported
- ::std::auto_ptr< IKeyPredicateLess > pComparator( getStandardLessPredicate( aKeyType, NULL ) );
+ ::std::unique_ptr< IKeyPredicateLess > pComparator( getStandardLessPredicate( aKeyType, NULL ) );
if ( !pComparator.get() )
throw IllegalTypeException("Unsupported key type.", *this );
// init members
m_aData.m_aKeyType = aKeyType;
m_aData.m_aValueType = aValueType;
- m_aData.m_pKeyCompare = pComparator;
+ m_aData.m_pKeyCompare = std::move(pComparator);
m_aData.m_pValues.reset( new KeyedValues( *m_aData.m_pKeyCompare ) );
m_aData.m_bMutable = bMutable;
diff --git a/comphelper/source/misc/anycompare.cxx b/comphelper/source/misc/anycompare.cxx
index 3d7d3f249eca..e4f038d3f665 100644
--- a/comphelper/source/misc/anycompare.cxx
+++ b/comphelper/source/misc/anycompare.cxx
@@ -176,11 +176,9 @@ namespace comphelper
};
- ::std::auto_ptr< IKeyPredicateLess > getStandardLessPredicate( Type const & i_type, Reference< XCollator > const & i_collator )
+ ::std::unique_ptr< IKeyPredicateLess > getStandardLessPredicate( Type const & i_type, Reference< XCollator > const & i_collator )
{
- SAL_WNODEPRECATED_DECLARATIONS_PUSH
- ::std::auto_ptr< IKeyPredicateLess > pComparator;
- SAL_WNODEPRECATED_DECLARATIONS_POP
+ ::std::unique_ptr< IKeyPredicateLess > pComparator;
switch ( i_type.getTypeClass() )
{
case TypeClass_CHAR:
diff --git a/comphelper/source/property/MasterPropertySet.cxx b/comphelper/source/property/MasterPropertySet.cxx
index a4fa97668c03..6cb5abfe24da 100644
--- a/comphelper/source/property/MasterPropertySet.cxx
+++ b/comphelper/source/property/MasterPropertySet.cxx
@@ -45,7 +45,7 @@ AutoOGuardArray::AutoOGuardArray( sal_Int32 nNumElements ) : mpGuardArray(new bo
AutoOGuardArray::~AutoOGuardArray()
{
- //!! release auto_ptr's and thus the mutexes locks
+ //!! release scoped_ptr's and thus the mutexes locks
delete [] mpGuardArray;
}
@@ -216,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 an auto_ptr to an array of OGuards in order to have the
+ //!! have a scoped_ptr to an array of OGuards in order to have the
//!! allocated memory properly freed (exception safe!).
- //!! Since the array itself has auto_ptrs as members we have to use a
+ //!! Since the array itself has scoped_ptrs as members we have to use a
//!! helper class 'AutoOGuardArray' in order to have
//!! the acquired locks properly released.
AutoOGuardArray aOGuardArray( nCount );
@@ -281,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 auto_ptr to an array of OGuards in order to have the
+ //!! have an scoped_ptr to an array of OGuards in order to have the
//!! allocated memory properly freed (exception safe!).
- //!! Since the array itself has auto_ptrs as members we have to use a
+ //!! Since the array itself has scoped_ptrs as members we have to use a
//!! helper class 'AutoOGuardArray' in order to have
//!! the acquired locks properly released.
AutoOGuardArray aOGuardArray( nCount );
diff --git a/comphelper/source/property/opropertybag.hxx b/comphelper/source/property/opropertybag.hxx
index 9cabfa0ac5e1..7211748f7219 100644
--- a/comphelper/source/property/opropertybag.hxx
+++ b/comphelper/source/property/opropertybag.hxx
@@ -77,7 +77,7 @@ namespace comphelper
{
private:
/// our IPropertyArrayHelper implementation
- ::std::auto_ptr< ::cppu::OPropertyArrayHelper >
+ ::std::unique_ptr< ::cppu::OPropertyArrayHelper >
m_pArrayHelper;
::comphelper::PropertyBag
m_aDynamicProperties;