diff options
author | Arnold Dumas <arnold@dumas.at> | 2017-02-10 20:10:11 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-11 15:06:09 +0000 |
commit | 71eab1c4b0f7516b57c2bd863335522885fa81f8 (patch) | |
tree | 5ee9974431982b7a250f639e953c696f4ae15f99 /sd | |
parent | c639ae462b3d4cc76077b48320164a13b30c7666 (diff) |
tdf#89329: Use unique_ptr for pImpl in stlfamily
Change-Id: I0c9df5809a906dbc761f9a51c3424cebb215d0bc
Reviewed-on: https://gerrit.libreoffice.org/34132
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/inc/stlfamily.hxx | 2 | ||||
-rw-r--r-- | sd/source/core/stlfamily.cxx | 8 |
2 files changed, 2 insertions, 8 deletions
diff --git a/sd/inc/stlfamily.hxx b/sd/inc/stlfamily.hxx index 3d6e6248da6b..264a318c47cc 100644 --- a/sd/inc/stlfamily.hxx +++ b/sd/inc/stlfamily.hxx @@ -112,7 +112,7 @@ private: SfxStyleFamily mnFamily; rtl::Reference< SfxStyleSheetPool > mxPool; - SdStyleFamilyImpl* mpImpl; + std::unique_ptr<SdStyleFamilyImpl> mpImpl; }; typedef rtl::Reference< SdStyleFamily > SdStyleFamilyRef; diff --git a/sd/source/core/stlfamily.cxx b/sd/source/core/stlfamily.cxx index fb80874b0486..2099abccc62c 100644 --- a/sd/source/core/stlfamily.cxx +++ b/sd/source/core/stlfamily.cxx @@ -95,7 +95,6 @@ PresStyleMap& SdStyleFamilyImpl::getStyleSheets() SdStyleFamily::SdStyleFamily( const rtl::Reference< SfxStyleSheetPool >& xPool, SfxStyleFamily nFamily ) : mnFamily( nFamily ) , mxPool( xPool ) -, mpImpl( nullptr ) { } @@ -111,7 +110,6 @@ SdStyleFamily::SdStyleFamily( const rtl::Reference< SfxStyleSheetPool >& xPool, SdStyleFamily::~SdStyleFamily() { DBG_ASSERT( !mxPool.is(), "SdStyleFamily::~SdStyleFamily(), dispose me first!" ); - delete mpImpl; } void SdStyleFamily::throwIfDisposed() const @@ -462,11 +460,7 @@ void SAL_CALL SdStyleFamily::dispose( ) if( mxPool.is() ) mxPool.clear(); - if( mpImpl ) - { - delete mpImpl; - mpImpl = nullptr; - } + mpImpl.reset(); } void SAL_CALL SdStyleFamily::addEventListener( const Reference< XEventListener >& ) |