From 9f5c54856fe24f5ada639f7eaff2cfbf744c8cfe Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 26 Jan 2017 09:06:38 +0100 Subject: [PATCH] loplugin:useuniqueptr Change-Id: I5091c2b4550dee1f0b602a5337e17fe78b9d07f9 --- ucb/source/ucp/webdav/webdavcontentcaps.cxx | 3 ++- ucb/source/ucp/webdav/webdavprovider.cxx | 7 ++----- ucb/source/ucp/webdav/webdavprovider.hxx | 6 +++++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ucb/source/ucp/webdav/webdavcontentcaps.cxx b/ucb/source/ucp/webdav/webdavcontentcaps.cxx index 08e95e2fa051..d8e19447a31b 100644 --- a/ucb/source/ucp/webdav/webdavcontentcaps.cxx +++ b/ucb/source/ucp/webdav/webdavcontentcaps.cxx @@ -32,6 +32,7 @@ #include #include #include +#include #include "webdavcontent.hxx" #include "webdavprovider.hxx" #include "DAVSession.hxx" @@ -52,7 +53,7 @@ bool ContentProvider::getProperty( osl::MutexGuard aGuard( m_aMutex ); if ( !m_pProps ) { - m_pProps = new PropertyMap; + m_pProps = o3tl::make_unique(); // Fill map of known properties... diff --git a/ucb/source/ucp/webdav/webdavprovider.cxx b/ucb/source/ucp/webdav/webdavprovider.cxx index 0cca80f5bc95..cbc7cc32ec32 100644 --- a/ucb/source/ucp/webdav/webdavprovider.cxx +++ b/ucb/source/ucp/webdav/webdavprovider.cxx @@ -37,17 +37,14 @@ using namespace http_dav_ucp; ContentProvider::ContentProvider( const uno::Reference< uno::XComponentContext >& rContext ) : ::ucbhelper::ContentProviderImplHelper( rContext ), - m_xDAVSessionFactory( new DAVSessionFactory() ), - m_pProps( nullptr ) + m_xDAVSessionFactory( new DAVSessionFactory() ) { } // virtual ContentProvider::~ContentProvider() -{ - delete m_pProps; -} +{} // XInterface methods. diff --git a/ucb/source/ucp/webdav/webdavprovider.hxx b/ucb/source/ucp/webdav/webdavprovider.hxx index 3231eb239183..2672b262383a 100644 --- a/ucb/source/ucp/webdav/webdavprovider.hxx +++ b/ucb/source/ucp/webdav/webdavprovider.hxx @@ -21,6 +21,10 @@ #ifndef INCLUDED_UCB_SOURCE_UCP_WEBDAV_WEBDAVPROVIDER_HXX #define INCLUDED_UCB_SOURCE_UCP_WEBDAV_WEBDAVPROVIDER_HXX +#include + +#include + #include #include #include "DAVSessionFactory.hxx" @@ -62,7 +66,7 @@ namespace http_dav_ucp { class ContentProvider : public ::ucbhelper::ContentProviderImplHelper { rtl::Reference< DAVSessionFactory > m_xDAVSessionFactory; - PropertyMap * m_pProps; + std::unique_ptr m_pProps; public: explicit ContentProvider( const css::uno::Reference< css::uno::XComponentContext >& rContext );