diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-01-23 18:03:16 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-01-23 18:03:16 +0100 |
commit | c010fe8e5eb781899d77ac18ce6c2c4b74f6fcfd (patch) | |
tree | f0c99f71fd396bff147f7ebdf558d9b5acd178c9 /embedserv/source/inprocserv/advisesink.cxx | |
parent | a90a4810aeefbad270978ade194ced3b09d50449 (diff) |
loplugin:useuniqueptr
Change-Id: I510731d7364a9fb670782a743cdefc4582e8c593
Diffstat (limited to 'embedserv/source/inprocserv/advisesink.cxx')
-rw-r--r-- | embedserv/source/inprocserv/advisesink.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/embedserv/source/inprocserv/advisesink.cxx b/embedserv/source/inprocserv/advisesink.cxx index e036e30850b3..8028fdb61e28 100644 --- a/embedserv/source/inprocserv/advisesink.cxx +++ b/embedserv/source/inprocserv/advisesink.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <o3tl/make_unique.hxx> + #if defined _MSC_VER #pragma warning(disable : 4668) #endif @@ -28,7 +32,6 @@ namespace inprocserv OleWrapperAdviseSink::OleWrapperAdviseSink() : m_nRefCount( 0 ) -, m_pFormatEtc( nullptr ) , m_nAspect( DVASPECT_CONTENT ) , m_nRegID( 0 ) , m_bObjectAdvise( TRUE ) @@ -42,7 +45,6 @@ OleWrapperAdviseSink::OleWrapperAdviseSink() OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pListener ) : m_nRefCount( 0 ) , m_pListener( pListener ) -, m_pFormatEtc( nullptr ) , m_nAspect( DVASPECT_CONTENT ) , m_nRegID( 0 ) , m_bObjectAdvise( TRUE ) @@ -56,7 +58,6 @@ OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pList OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pListener, FORMATETC* pFormatEtc, DWORD nDataRegFlag ) : m_nRefCount( 0 ) , m_pListener( pListener ) -, m_pFormatEtc( nullptr ) , m_nAspect( DVASPECT_CONTENT ) , m_nRegID( 0 ) , m_bObjectAdvise( FALSE ) @@ -67,7 +68,7 @@ OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pList { if ( pFormatEtc ) { - m_pFormatEtc = new FORMATETC; + m_pFormatEtc = o3tl::make_unique<FORMATETC>(); m_pFormatEtc->cfFormat = pFormatEtc->cfFormat; m_pFormatEtc->ptd = nullptr; m_pFormatEtc->dwAspect = pFormatEtc->dwAspect; @@ -79,7 +80,6 @@ OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pList OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pListener, DWORD nAspect, DWORD nViewRegFlag ) : m_nRefCount( 0 ) , m_pListener( pListener ) -, m_pFormatEtc( nullptr ) , m_nAspect( nAspect ) , m_nRegID( 0 ) , m_bObjectAdvise( TRUE ) @@ -91,9 +91,7 @@ OleWrapperAdviseSink::OleWrapperAdviseSink( const ComSmart< IAdviseSink >& pList } OleWrapperAdviseSink::~OleWrapperAdviseSink() -{ - delete m_pFormatEtc; -} +{} STDMETHODIMP OleWrapperAdviseSink::QueryInterface( REFIID riid , void** ppv ) { |