From 3aaa90c36c2910847576bd9362276b0e9b5acca4 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Thu, 26 May 2016 01:48:15 +0200 Subject: tdf#89329: use unique_ptr for pImpl in toolbarmenu Change-Id: I2adafe082bd83edc31777f11f66313a51fde7d81 Reviewed-on: https://gerrit.libreoffice.org/25478 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/svtools/toolbarmenu.hxx | 2 +- svtools/source/control/toolbarmenu.cxx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/svtools/toolbarmenu.hxx b/include/svtools/toolbarmenu.hxx index a5f06e7a36a3..ac38dbd5fdc1 100644 --- a/include/svtools/toolbarmenu.hxx +++ b/include/svtools/toolbarmenu.hxx @@ -129,7 +129,7 @@ private: ToolbarMenuEntry* implGetEntry( int nEntry ) const; ToolbarMenuEntry* implSearchEntry( int nEntryId ) const; - ToolbarMenu_Impl* mpImpl; + std::unique_ptr mpImpl; }; } // namespace svtools diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx index c846ef0a99eb..71accc7b6a8d 100644 --- a/svtools/source/control/toolbarmenu.cxx +++ b/svtools/source/control/toolbarmenu.cxx @@ -411,7 +411,7 @@ ToolbarMenu::ToolbarMenu( const Reference< XFrame >& rFrame, vcl::Window* pParen void ToolbarMenu::implInit(const Reference< XFrame >& rFrame) { - mpImpl = new ToolbarMenu_Impl( *this, rFrame ); + mpImpl.reset( new ToolbarMenu_Impl( *this, rFrame ) ); const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); SetControlBackground( rStyleSettings.GetMenuColor() ); @@ -443,8 +443,8 @@ void ToolbarMenu::dispose() mpImpl->mxAccessible.clear(); - std::unique_ptr pImpl{mpImpl}; - mpImpl = nullptr; + std::unique_ptr pImpl = std::move(pImpl); + mpImpl.reset(); pImpl->maEntryVector.clear(); -- cgit