loplugin:useuniqueptr

Change-Id: I5091c2b4550dee1f0b602a5337e17fe78b9d07f9
This commit is contained in:
Stephan Bergmann
2017-01-26 09:06:38 +01:00
parent 6a16775c78
commit 9f5c54856f
3 changed files with 9 additions and 7 deletions

View File

@@ -32,6 +32,7 @@
#include <com/sun/star/util/DateTime.hpp> #include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/ucb/Lock.hpp> #include <com/sun/star/ucb/Lock.hpp>
#include <com/sun/star/ucb/LockEntry.hpp> #include <com/sun/star/ucb/LockEntry.hpp>
#include <o3tl/make_unique.hxx>
#include "webdavcontent.hxx" #include "webdavcontent.hxx"
#include "webdavprovider.hxx" #include "webdavprovider.hxx"
#include "DAVSession.hxx" #include "DAVSession.hxx"
@@ -52,7 +53,7 @@ bool ContentProvider::getProperty(
osl::MutexGuard aGuard( m_aMutex ); osl::MutexGuard aGuard( m_aMutex );
if ( !m_pProps ) if ( !m_pProps )
{ {
m_pProps = new PropertyMap; m_pProps = o3tl::make_unique<PropertyMap>();
// Fill map of known properties... // Fill map of known properties...

View File

@@ -37,17 +37,14 @@ using namespace http_dav_ucp;
ContentProvider::ContentProvider( ContentProvider::ContentProvider(
const uno::Reference< uno::XComponentContext >& rContext ) const uno::Reference< uno::XComponentContext >& rContext )
: ::ucbhelper::ContentProviderImplHelper( rContext ), : ::ucbhelper::ContentProviderImplHelper( rContext ),
m_xDAVSessionFactory( new DAVSessionFactory() ), m_xDAVSessionFactory( new DAVSessionFactory() )
m_pProps( nullptr )
{ {
} }
// virtual // virtual
ContentProvider::~ContentProvider() ContentProvider::~ContentProvider()
{ {}
delete m_pProps;
}
// XInterface methods. // XInterface methods.

View File

@@ -21,6 +21,10 @@
#ifndef INCLUDED_UCB_SOURCE_UCP_WEBDAV_WEBDAVPROVIDER_HXX #ifndef INCLUDED_UCB_SOURCE_UCP_WEBDAV_WEBDAVPROVIDER_HXX
#define INCLUDED_UCB_SOURCE_UCP_WEBDAV_WEBDAVPROVIDER_HXX #define INCLUDED_UCB_SOURCE_UCP_WEBDAV_WEBDAVPROVIDER_HXX
#include <sal/config.h>
#include <memory>
#include <rtl/ref.hxx> #include <rtl/ref.hxx>
#include <com/sun/star/beans/Property.hpp> #include <com/sun/star/beans/Property.hpp>
#include "DAVSessionFactory.hxx" #include "DAVSessionFactory.hxx"
@@ -62,7 +66,7 @@ namespace http_dav_ucp {
class ContentProvider : public ::ucbhelper::ContentProviderImplHelper class ContentProvider : public ::ucbhelper::ContentProviderImplHelper
{ {
rtl::Reference< DAVSessionFactory > m_xDAVSessionFactory; rtl::Reference< DAVSessionFactory > m_xDAVSessionFactory;
PropertyMap * m_pProps; std::unique_ptr<PropertyMap> m_pProps;
public: public:
explicit ContentProvider( const css::uno::Reference< css::uno::XComponentContext >& rContext ); explicit ContentProvider( const css::uno::Reference< css::uno::XComponentContext >& rContext );