[Libreoffice-commits] core.git: include/sfx2 sfx2/source

Xisco Fauli anistenis at gmail.com
Tue May 24 07:42:45 UTC 2016


 include/sfx2/tbxctrl.hxx        |    2 +-
 sfx2/source/toolbox/tbxitem.cxx |    6 ++----
 2 files changed, 3 insertions(+), 5 deletions(-)

New commits:
commit e0788463c3ec790ee002fc1610a9206f2ac7c10d
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Sun May 22 18:09:36 2016 +0200

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

diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
index b77a4ca..6e66fb7 100644
--- a/include/sfx2/tbxctrl.hxx
+++ b/include/sfx2/tbxctrl.hxx
@@ -151,7 +151,7 @@ friend class SfxToolbox;
 friend class SfxPopupWindow;
 friend struct SfxTbxCtrlFactory;
 
-    SfxToolBoxControl_Impl*    pImpl;
+    std::unique_ptr< SfxToolBoxControl_Impl>    pImpl;
 
 protected:
     DECL_LINK_TYPED( PopupModeEndHdl, FloatingWindow*, void );
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index d036ad1..1f0a2d9 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -212,9 +212,8 @@ SfxToolBoxControl::SfxToolBoxControl(
     sal_uInt16      nID,
     ToolBox&        rBox,
     bool            bShowStringItems     )
+    : pImpl( new SfxToolBoxControl_Impl )
 {
-    pImpl = new SfxToolBoxControl_Impl;
-
     pImpl->pBox = &rBox;
     pImpl->bShowString = bShowStringItems;
     pImpl->pFact = nullptr;
@@ -227,7 +226,6 @@ SfxToolBoxControl::SfxToolBoxControl(
 
 SfxToolBoxControl::~SfxToolBoxControl()
 {
-    delete pImpl;
 }
 
 
@@ -627,7 +625,7 @@ IMPL_LINK_NOARG_TYPED(SfxToolBoxControl, PopupModeEndHdl, FloatingWindow*, void)
         pImpl->mpPopupWindow.clear();
         // We also need to know when the user tries to use the
         // floating window.
-        pImpl->mpFloatingWindow->AddEventListener( LINK( pImpl, SfxToolBoxControl_Impl, WindowEventListener ));
+        pImpl->mpFloatingWindow->AddEventListener( LINK( pImpl.get(), SfxToolBoxControl_Impl, WindowEventListener ));
     }
     else
     {


More information about the Libreoffice-commits mailing list