summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-05-22 18:09:36 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-24 07:42:22 +0000
commite0788463c3ec790ee002fc1610a9206f2ac7c10d (patch)
tree6603196a95590ec97f391debc9ea42bd9052dc2d
parent8441cd025a694b25ca6795ac05f1a6dd910a6bbb (diff)
tdf#89329: use unique_ptr for pImpl in tbxctrl
Change-Id: I309435b73e3d490cc091dd875f7f600e6f2f354c Reviewed-on: https://gerrit.libreoffice.org/25322 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--include/sfx2/tbxctrl.hxx2
-rw-r--r--sfx2/source/toolbox/tbxitem.cxx6
2 files changed, 3 insertions, 5 deletions
diff --git a/include/sfx2/tbxctrl.hxx b/include/sfx2/tbxctrl.hxx
index b77a4ca316b2..6e66fb7cba40 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 d036ad1cdaec..1f0a2d92c1c2 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
{