summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2016-05-26 01:48:15 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-01 06:48:31 +0000
commit3aaa90c36c2910847576bd9362276b0e9b5acca4 (patch)
treecb4338f7870b8b49b3f3128f9e14c4ea511203ba
parentfa135fd0e05fc4ba784b4349d65f2e5ed26c0f55 (diff)
tdf#89329: use unique_ptr for pImpl in toolbarmenu
Change-Id: I2adafe082bd83edc31777f11f66313a51fde7d81 Reviewed-on: https://gerrit.libreoffice.org/25478 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--include/svtools/toolbarmenu.hxx2
-rw-r--r--svtools/source/control/toolbarmenu.cxx6
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<ToolbarMenu_Impl> 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<ToolbarMenu_Impl> pImpl{mpImpl};
- mpImpl = nullptr;
+ std::unique_ptr<ToolbarMenu_Impl> pImpl = std::move(pImpl);
+ mpImpl.reset();
pImpl->maEntryVector.clear();