diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-10-01 17:16:02 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-10-01 17:35:13 +0200 |
commit | ee8e81ad860f70a8c2467eaba79df93fe32e9c17 (patch) | |
tree | 65b2770c42183cd3a5200946fdaacdc97a3104dd /ucb | |
parent | b0f43c629b23432008eccb78e6b2d6ef50d03103 (diff) |
ucb: std::auto_ptr -> std::unique_ptr
Change-Id: I779b7a172cecd927f7d18fcbbc0f898f18089d0a
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_stgelems.hxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/tdoc/tdoc_storage.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/ContentProperties.cxx | 4 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/ContentProperties.hxx | 4 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/DAVSession.hxx | 7 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/DAVSessionFactory.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/DAVSessionFactory.hxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavcontent.cxx | 72 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavcontent.hxx | 12 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx | 10 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/DAVSession.hxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/DAVSessionFactory.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/webdav/DAVSessionFactory.hxx | 2 |
13 files changed, 38 insertions, 85 deletions
diff --git a/ucb/source/ucp/tdoc/tdoc_stgelems.hxx b/ucb/source/ucp/tdoc/tdoc_stgelems.hxx index f44e4245a56e..8be3935052d8 100644 --- a/ucb/source/ucp/tdoc/tdoc_stgelems.hxx +++ b/ucb/source/ucp/tdoc/tdoc_stgelems.hxx @@ -301,7 +301,7 @@ private: StorageElementFactory::StorageMap::iterator m_aContainerIt; friend class StorageElementFactory; - friend class std::auto_ptr< Storage >; + friend class std::unique_ptr< Storage >; }; diff --git a/ucb/source/ucp/tdoc/tdoc_storage.cxx b/ucb/source/ucp/tdoc/tdoc_storage.cxx index d22600065327..a1a26890b412 100644 --- a/ucb/source/ucp/tdoc/tdoc_storage.cxx +++ b/ucb/source/ucp/tdoc/tdoc_storage.cxx @@ -180,7 +180,7 @@ StorageElementFactory::createStorage( const OUString & rUri, bool bWritable = ( ( eMode == READ_WRITE_NOCREATE ) || ( eMode == READ_WRITE_CREATE ) ); - std::auto_ptr< Storage > xElement( + std::unique_ptr< Storage > xElement( new Storage( m_xContext, this, aUriKey, xParentStorage, xStorage ) ); aIt = m_aMap.insert( diff --git a/ucb/source/ucp/webdav-neon/ContentProperties.cxx b/ucb/source/ucp/webdav-neon/ContentProperties.cxx index 6e6416eb5115..de70572f9258 100644 --- a/ucb/source/ucp/webdav-neon/ContentProperties.cxx +++ b/ucb/source/ucp/webdav-neon/ContentProperties.cxx @@ -581,9 +581,7 @@ CachableContentProperties::CachableContentProperties( void CachableContentProperties::addProperties( const ContentProperties & rProps ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - const std::auto_ptr< PropertyValueMap > & props = rProps.getProperties(); - SAL_WNODEPRECATED_DECLARATIONS_POP + const std::unique_ptr< PropertyValueMap > & props = rProps.getProperties(); PropertyValueMap::const_iterator it = props->begin(); const PropertyValueMap::const_iterator end = props->end(); diff --git a/ucb/source/ucp/webdav-neon/ContentProperties.hxx b/ucb/source/ucp/webdav-neon/ContentProperties.hxx index 07feceeae0ef..0a3cf70ee70c 100644 --- a/ucb/source/ucp/webdav-neon/ContentProperties.hxx +++ b/ucb/source/ucp/webdav-neon/ContentProperties.hxx @@ -158,12 +158,12 @@ public: // Not good to expose implementation details, but this is actually an // internal class. - const std::auto_ptr< PropertyValueMap > & getProperties() const + const std::unique_ptr< PropertyValueMap > & getProperties() const { return m_xProps; } private: OUString m_aEscapedTitle; - std::auto_ptr< PropertyValueMap > m_xProps; + std::unique_ptr< PropertyValueMap > m_xProps; bool m_bTrailingSlash; static com::sun::star::uno::Any m_aEmptyAny; diff --git a/ucb/source/ucp/webdav-neon/DAVSession.hxx b/ucb/source/ucp/webdav-neon/DAVSession.hxx index 033cb3749ed4..c75ce7ecf98a 100644 --- a/ucb/source/ucp/webdav-neon/DAVSession.hxx +++ b/ucb/source/ucp/webdav-neon/DAVSession.hxx @@ -210,12 +210,7 @@ private: oslInterlockedCount m_nRefCount; friend class DAVSessionFactory; -#if defined ( _MSC_VER ) && _MSC_VER < 1310 - friend struct std::auto_ptr< DAVSession >; - // work around compiler bug... -#else // WNT - friend class std::auto_ptr< DAVSession >; -#endif // WNT + friend struct std::default_delete< DAVSession >; }; } // namespace webdav_ucp diff --git a/ucb/source/ucp/webdav-neon/DAVSessionFactory.cxx b/ucb/source/ucp/webdav-neon/DAVSessionFactory.cxx index 5132a4fe29d6..0c650abbdccd 100644 --- a/ucb/source/ucp/webdav-neon/DAVSessionFactory.cxx +++ b/ucb/source/ucp/webdav-neon/DAVSessionFactory.cxx @@ -66,7 +66,7 @@ rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession( { NeonUri aURI( inUri ); - std::auto_ptr< DAVSession > xElement( + std::unique_ptr< DAVSession > xElement( new NeonSession( this, inUri, rFlags, *m_xProxyDecider.get() ) ); aIt = m_aMap.insert( Map::value_type( inUri, xElement.get() ) ).first; diff --git a/ucb/source/ucp/webdav-neon/DAVSessionFactory.hxx b/ucb/source/ucp/webdav-neon/DAVSessionFactory.hxx index 8dde5675fa81..f23bb0dad43f 100644 --- a/ucb/source/ucp/webdav-neon/DAVSessionFactory.hxx +++ b/ucb/source/ucp/webdav-neon/DAVSessionFactory.hxx @@ -73,7 +73,7 @@ private: Map m_aMap; osl::Mutex m_aMutex; - std::auto_ptr< ucbhelper::InternetProxyDecider > m_xProxyDecider; + std::unique_ptr< ucbhelper::InternetProxyDecider > m_xProxyDecider; ::uno::Reference< ::uno::XComponentContext > m_xContext; diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index ea8ecb48d5ac..84a2e6cca713 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -545,9 +545,7 @@ uno::Any SAL_CALL Content::execute( // { try { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); @@ -736,9 +734,7 @@ void SAL_CALL Content::abort( sal_Int32 /*CommandId*/ ) { try { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); @@ -827,9 +823,7 @@ void Content::addProperty( const ucb::PropertyCommandArgument& aCmdArg, try { // Set property value at server. - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); @@ -919,9 +913,7 @@ void Content::removeProperty( const OUString& Name, aProppatchValues.push_back( aValue ); // Remove property value from server. - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); @@ -1203,9 +1195,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( else { // Append all standard UCB, DAV and HTTP properties. - SAL_WNODEPRECATED_DECLARATIONS_PUSH - const std::auto_ptr< PropertyValueMap > & xProps = rData.getProperties(); - SAL_WNODEPRECATED_DECLARATIONS_POP + const std::unique_ptr< PropertyValueMap > & xProps = rData.getProperties(); PropertyValueMap::const_iterator it = xProps->begin(); PropertyValueMap::const_iterator end = xProps->end(); @@ -1238,11 +1228,9 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues( const uno::Reference< ucb::XCommandEnvironment >& xEnv ) throw ( uno::Exception, std::exception ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< ContentProperties > xProps; - std::auto_ptr< ContentProperties > xCachedProps; - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< ContentProperties > xProps; + std::unique_ptr< ContentProperties > xCachedProps; + std::unique_ptr< DAVResourceAccess > xResAccess; OUString aUnescapedTitle; bool bHasAll = false; uno::Reference< ucb::XContentIdentifier > xIdentifier; @@ -1551,9 +1539,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( uno::Reference< ucb::XContentIdentifier > xIdentifier; rtl::Reference< ContentProvider > xProvider; bool bTransient; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); @@ -2013,9 +1999,7 @@ uno::Any Content::open( // PUSH: write data try { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); @@ -2061,9 +2045,7 @@ uno::Any Content::open( // PULL: wait for client read try { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); @@ -2135,9 +2117,7 @@ void Content::post( { try { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); xResAccess.reset( @@ -2171,9 +2151,7 @@ void Content::post( { try { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); xResAccess.reset( @@ -2272,9 +2250,7 @@ void Content::insert( { bool bTransient, bCollection; OUString aEscapedTitle; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); @@ -2515,9 +2491,7 @@ void Content::transfer( { uno::Reference< ucb::XContentIdentifier > xIdentifier; uno::Reference< ucb::XContentProvider > xProvider; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); @@ -2802,9 +2776,7 @@ void Content::lock( { try { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); @@ -2845,9 +2817,7 @@ void Content::unlock( { try { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::Guard< osl::Mutex > aGuard( m_aMutex ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); @@ -3153,7 +3123,7 @@ void Content::cancelCommandExecution( SAL_WNODEPRECATED_DECLARATIONS_PUSH const OUString -Content::getBaseURI( const std::auto_ptr< DAVResourceAccess > & rResAccess ) +Content::getBaseURI( const std::unique_ptr< DAVResourceAccess > & rResAccess ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); @@ -3184,7 +3154,7 @@ Content::getBaseURI( const std::auto_ptr< DAVResourceAccess > & rResAccess ) Content::ResourceType Content::getResourceType( const uno::Reference< ucb::XCommandEnvironment >& xEnv, - const std::auto_ptr< DAVResourceAccess > & rResAccess, + const std::unique_ptr< DAVResourceAccess > & rResAccess, bool * networkAccessAllowed) throw ( uno::Exception, std::exception ) { @@ -3272,9 +3242,7 @@ Content::ResourceType Content::getResourceType( const uno::Reference< ucb::XCommandEnvironment >& xEnv ) throw ( uno::Exception, std::exception ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; { osl::MutexGuard aGuard( m_aMutex ); xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) ); diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.hxx b/ucb/source/ucp/webdav-neon/webdavcontent.hxx index 7705c4e2aa1e..6e9540704c78 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.hxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.hxx @@ -84,8 +84,8 @@ class Content : public ::ucbhelper::ContentImplHelper, DAV }; - std::auto_ptr< DAVResourceAccess > m_xResAccess; - std::auto_ptr< CachableContentProperties > + std::unique_ptr< DAVResourceAccess > m_xResAccess; + std::unique_ptr< CachableContentProperties > m_xCachedProps; // locally cached props OUString m_aEscapedTitle; ResourceType m_eResourceType; @@ -131,24 +131,20 @@ private: exchangeIdentity( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XContentIdentifier >& xNewId ); - SAL_WNODEPRECATED_DECLARATIONS_PUSH const OUString - getBaseURI( const std::auto_ptr< DAVResourceAccess > & rResAccess ); - SAL_WNODEPRECATED_DECLARATIONS_POP + getBaseURI( const std::unique_ptr< DAVResourceAccess > & rResAccess ); ResourceType getResourceType( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& xEnv ) throw ( ::com::sun::star::uno::Exception, std::exception ); - SAL_WNODEPRECATED_DECLARATIONS_PUSH ResourceType getResourceType( const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >& xEnv, - const std::auto_ptr< DAVResourceAccess > & rResAccess, + const std::unique_ptr< DAVResourceAccess > & rResAccess, bool * networkAccessAllowed = 0) throw ( ::com::sun::star::uno::Exception, std::exception ); - SAL_WNODEPRECATED_DECLARATIONS_POP // Command "open" com::sun::star::uno::Any open( diff --git a/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx b/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx index f052e06d5755..98ad9fcbf0b5 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontentcaps.cxx @@ -299,10 +299,8 @@ uno::Sequence< beans::Property > Content::getProperties( const uno::Reference< ucb::XCommandEnvironment > & xEnv ) { bool bTransient; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< DAVResourceAccess > xResAccess; - std::auto_ptr< ContentProperties > xCachedProps; - SAL_WNODEPRECATED_DECLARATIONS_POP + std::unique_ptr< DAVResourceAccess > xResAccess; + std::unique_ptr< ContentProperties > xCachedProps; rtl::Reference< ContentProvider > xProvider; { @@ -481,10 +479,8 @@ uno::Sequence< beans::Property > Content::getProperties( const std::set< OUString >::const_iterator set_end = aPropSet.end(); - SAL_WNODEPRECATED_DECLARATIONS_PUSH - const std::auto_ptr< PropertyValueMap > & xProps + const std::unique_ptr< PropertyValueMap > & xProps = xCachedProps->getProperties(); - SAL_WNODEPRECATED_DECLARATIONS_POP PropertyValueMap::const_iterator map_it = xProps->begin(); const PropertyValueMap::const_iterator map_end = xProps->end(); diff --git a/ucb/source/ucp/webdav/DAVSession.hxx b/ucb/source/ucp/webdav/DAVSession.hxx index bc8f8dd015cf..45a13838edca 100644 --- a/ucb/source/ucp/webdav/DAVSession.hxx +++ b/ucb/source/ucp/webdav/DAVSession.hxx @@ -203,7 +203,7 @@ private: oslInterlockedCount m_nRefCount; friend class DAVSessionFactory; - friend class std::auto_ptr< DAVSession >; + friend struct std::default_delete< DAVSession >; }; } // namespace http_dav_ucp diff --git a/ucb/source/ucp/webdav/DAVSessionFactory.cxx b/ucb/source/ucp/webdav/DAVSessionFactory.cxx index cab6d863180b..abb74ee7b7c8 100644 --- a/ucb/source/ucp/webdav/DAVSessionFactory.cxx +++ b/ucb/source/ucp/webdav/DAVSessionFactory.cxx @@ -54,7 +54,7 @@ rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession( { SerfUri aURI( inUri ); - std::auto_ptr< DAVSession > xElement( + std::unique_ptr< DAVSession > xElement( new SerfSession( this, inUri, *m_xProxyDecider.get() ) ); aIt = m_aMap.insert( Map::value_type( inUri, xElement.get() ) ).first; diff --git a/ucb/source/ucp/webdav/DAVSessionFactory.hxx b/ucb/source/ucp/webdav/DAVSessionFactory.hxx index 18d21192567d..55e01f2c03fa 100644 --- a/ucb/source/ucp/webdav/DAVSessionFactory.hxx +++ b/ucb/source/ucp/webdav/DAVSessionFactory.hxx @@ -61,7 +61,7 @@ private: Map m_aMap; osl::Mutex m_aMutex; - std::auto_ptr< ucbhelper::InternetProxyDecider > m_xProxyDecider; + std::unique_ptr< ucbhelper::InternetProxyDecider > m_xProxyDecider; void releaseElement( DAVSession * pElement ); |