summaryrefslogtreecommitdiff
path: root/framework/source/uielement/togglebuttontoolbarcontroller.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-06-20 15:56:35 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-23 06:28:00 +0000
commitaa0d0536a444fb26d9e570bd6bf6c1bdc3596cf3 (patch)
tree8b2a5207e77fa4054a37b33c25378c23a00af8ed /framework/source/uielement/togglebuttontoolbarcontroller.cxx
parentb722f3d6fc72877e8caaaae7291d5d736ddc494d (diff)
tdf#97527 - vcl: reference-count Menu
some places are marked with "dodgy"- need to check those to see what is going on, because they are leaving dangling pointers behind in the Menu class Change-Id: I41d5c7c0fec2f70ce9e3ffdc48cd03d26c0a869b Reviewed-on: https://gerrit.libreoffice.org/26516 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'framework/source/uielement/togglebuttontoolbarcontroller.cxx')
-rw-r--r--framework/source/uielement/togglebuttontoolbarcontroller.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/framework/source/uielement/togglebuttontoolbarcontroller.cxx b/framework/source/uielement/togglebuttontoolbarcontroller.cxx
index 5dd73a65a47e..4e726c191312 100644
--- a/framework/source/uielement/togglebuttontoolbarcontroller.cxx
+++ b/framework/source/uielement/togglebuttontoolbarcontroller.cxx
@@ -102,21 +102,21 @@ throw (css::uno::RuntimeException, std::exception)
( m_eStyle == STYLE_TOGGLE_DROPDOWNBUTTON ))
{
// create popup menu
- ::PopupMenu aPopup;
+ ScopedVclPtrInstance<::PopupMenu> aPopup;
const sal_uInt32 nCount = m_aDropdownMenuList.size();
for ( sal_uInt32 i = 0; i < nCount; i++ )
{
OUString aLabel( m_aDropdownMenuList[i] );
- aPopup.InsertItem( sal_uInt16( i+1 ), aLabel );
+ aPopup->InsertItem( sal_uInt16( i+1 ), aLabel );
if ( aLabel == m_aCurrentSelection )
- aPopup.CheckItem( sal_uInt16( i+1 ) );
+ aPopup->CheckItem( sal_uInt16( i+1 ) );
else
- aPopup.CheckItem( sal_uInt16( i+1 ), false );
+ aPopup->CheckItem( sal_uInt16( i+1 ), false );
}
m_pToolbar->SetItemDown( m_nID, true );
- aPopup.SetSelectHdl( LINK( this, ToggleButtonToolbarController, MenuSelectHdl ));
- aPopup.Execute( m_pToolbar, m_pToolbar->GetItemRect( m_nID ));
+ aPopup->SetSelectHdl( LINK( this, ToggleButtonToolbarController, MenuSelectHdl ));
+ aPopup->Execute( m_pToolbar, m_pToolbar->GetItemRect( m_nID ));
m_pToolbar->SetItemDown( m_nID, false );
}