summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-08 14:41:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-06-09 13:12:47 +0200
commit7d521a85858bacdb7b5db359036ccf6f01b709c3 (patch)
treeee359fd27d55a0916e18e504d925949aa5b2a378 /vcl/source
parentb7abdafcfc42722ab060529864a2109d1e4198c0 (diff)
hold and return SalMenu by std::unique_ptr
and drop DestroyMenu, all the implementations just delete the object Change-Id: I673997ea1a9c5216b100cafdc70a8f697732769b Reviewed-on: https://gerrit.libreoffice.org/55501 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/app/salvtables.cxx7
-rw-r--r--vcl/source/window/menu.cxx4
2 files changed, 2 insertions, 9 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index d5ac7c95e513..00ff6c6a9090 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -87,17 +87,12 @@ std::unique_ptr<SalSession> SalInstance::CreateSalSession()
return nullptr;
}
-SalMenu* SalInstance::CreateMenu( bool, Menu* )
+std::unique_ptr<SalMenu> SalInstance::CreateMenu( bool, Menu* )
{
// default: no native menus
return nullptr;
}
-void SalInstance::DestroyMenu( SalMenu* pMenu )
-{
- OSL_ENSURE( pMenu == nullptr, "DestroyMenu called with non-native menus" );
-}
-
std::unique_ptr<SalMenuItem> SalInstance::CreateMenuItem( const SalItemParams & )
{
return nullptr;
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index ce19d83b85de..cf509a91374a 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2302,9 +2302,7 @@ OUString Menu::GetAccessibleName( sal_uInt16 nItemId ) const
void Menu::ImplClearSalMenu()
{
- if( mpSalMenu )
- ImplGetSVData()->mpDefInst->DestroyMenu( mpSalMenu );
- mpSalMenu = nullptr;
+ mpSalMenu.reset();
}
void Menu::GetSystemMenuData( SystemMenuData* pData ) const