[Libreoffice-commits] core.git: sd/inc sd/source

Arnold Dumas arnold at dumas.at
Sat Feb 11 15:06:32 UTC 2017


 sd/inc/stlfamily.hxx         |    2 +-
 sd/source/core/stlfamily.cxx |    8 +-------
 2 files changed, 2 insertions(+), 8 deletions(-)

New commits:
commit 71eab1c4b0f7516b57c2bd863335522885fa81f8
Author: Arnold Dumas <arnold at dumas.at>
Date:   Fri Feb 10 20:10:11 2017 +0100

    tdf#89329: Use unique_ptr for pImpl in stlfamily
    
    Change-Id: I0c9df5809a906dbc761f9a51c3424cebb215d0bc
    Reviewed-on: https://gerrit.libreoffice.org/34132
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sd/inc/stlfamily.hxx b/sd/inc/stlfamily.hxx
index 3d6e624..264a318 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 fb80874..2099abc 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 >&  )


More information about the Libreoffice-commits mailing list