[Libreoffice-commits] core.git: cui/source

Xisco Fauli anistenis at gmail.com
Mon May 23 13:37:24 UTC 2016


 cui/source/options/optsave.cxx |    7 +++----
 cui/source/options/optsave.hxx |    2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit bfc51d3fa8cd72e70837be1a9d1bc2195dc8ccf4
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Mon May 23 02:02:36 2016 +0200

    tdf#89329: use unique_ptr for pImpl in optsave
    
    Change-Id: Ia442a6a5c570c45b03fc878099f1c50005ee7538
    Reviewed-on: https://gerrit.libreoffice.org/25331
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index cbf4d7d..1130bb8 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -81,7 +81,7 @@ SvxSaveTabPage_Impl::~SvxSaveTabPage_Impl()
 
 SvxSaveTabPage::SvxSaveTabPage( vcl::Window* pParent, const SfxItemSet& rCoreSet ) :
     SfxTabPage( pParent, "OptSavePage", "cui/ui/optsavepage.ui", &rCoreSet ),
-    pImpl               ( new SvxSaveTabPage_Impl )
+    pImpl( new SvxSaveTabPage_Impl )
 {
     get(aLoadUserSettingsCB, "load_settings");
     get(aLoadDocPrinterCB,  "load_docprinter");
@@ -201,8 +201,7 @@ SvxSaveTabPage::~SvxSaveTabPage()
 
 void SvxSaveTabPage::dispose()
 {
-    delete pImpl;
-    pImpl = nullptr;
+    pImpl.reset();
     aLoadUserSettingsCB.clear();
     aLoadDocPrinterCB.clear();
     aDocInfoCB.clear();
@@ -586,7 +585,7 @@ IMPL_LINK_TYPED( SvxSaveTabPage, FilterHdl_Impl, ListBox&, rBox, void )
             {
                 const sal_Int32 nEntryPos = aSaveAsLB->InsertEntry(pUIFilters[i]);
                 if ( pImpl->aODFArr[nData][i] )
-                    aSaveAsLB->SetEntryData( nEntryPos, static_cast<void*>(pImpl) );
+                    aSaveAsLB->SetEntryData( nEntryPos, static_cast<void*>(pImpl.get()) );
                 if(pFilters[i] == pImpl->aDefaultArr[nData])
                     sSelect = pUIFilters[i];
             }
diff --git a/cui/source/options/optsave.hxx b/cui/source/options/optsave.hxx
index d97c323..53f5f9e 100644
--- a/cui/source/options/optsave.hxx
+++ b/cui/source/options/optsave.hxx
@@ -57,7 +57,7 @@ private:
     VclPtr<FixedImage>             aODFWarningFI;
     VclPtr<FixedText>              aODFWarningFT;
 
-    SvxSaveTabPage_Impl*    pImpl;
+    std::unique_ptr<SvxSaveTabPage_Impl>    pImpl;
 
     DECL_LINK_TYPED( AutoClickHdl_Impl, Button*, void );
     DECL_LINK_TYPED( FilterHdl_Impl, ListBox&, void );


More information about the Libreoffice-commits mailing list