summaryrefslogtreecommitdiff
path: root/sfx2/source/menu
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-01-23 18:38:45 +0100
committerMichael Stahl <mstahl@redhat.com>2012-01-23 18:40:34 +0100
commita0093404ffbca79655a52019d6bf66b976964fe9 (patch)
treec8e6d7de6658a7f6e8f0a890c5b6605f1463e300 /sfx2/source/menu
parent9bea733ecf01da09aaf7281868441b8a02fcf5cc (diff)
SfxVirtualMenu: fix context menu crash:
SfxMenuCtrlArr_Impl used to be a PTRARR_DEL, so use a boost::ptr_vector to ensure elements are deleted. (regression from 94d4764a42f8f38b884bb8960791d80ac876b786)
Diffstat (limited to 'sfx2/source/menu')
-rw-r--r--sfx2/source/menu/virtmenu.cxx20
1 files changed, 13 insertions, 7 deletions
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index c62dfd570013..0098ee534d4c 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -731,11 +731,14 @@ void SfxVirtualMenu::BindControllers()
}
SfxMenuCtrlArr_Impl& rCtrlArr = GetAppCtrl_Impl();
- for(SfxMenuCtrlArr_Impl::const_iterator i = rCtrlArr.begin(); i != rCtrlArr.end(); ++i)
+ for (SfxMenuCtrlArr_Impl::iterator i = rCtrlArr.begin();
+ i != rCtrlArr.end(); ++i)
{
- sal_uInt16 nSlotId = (*i)->GetId();
+ sal_uInt16 nSlotId = i->GetId();
if ( !pSVMenu->GetItemCommand(nSlotId).Len() )
- (*i)->ReBind();
+ {
+ i->ReBind();
+ }
}
pBindings->LEAVEREGISTRATIONS();
@@ -755,11 +758,14 @@ void SfxVirtualMenu::UnbindControllers()
}
SfxMenuCtrlArr_Impl& rCtrlArr = GetAppCtrl_Impl();
- for(SfxMenuCtrlArr_Impl::const_iterator i = rCtrlArr.begin(); i != rCtrlArr.end(); ++i)
+ for (SfxMenuCtrlArr_Impl::iterator i = rCtrlArr.begin();
+ i != rCtrlArr.end(); ++i)
{
- if((*i)->IsBound())
- // UnoController is not binded!
- (*i)->UnBind();
+ if (i->IsBound())
+ {
+ // UnoController is not bound!
+ i->UnBind();
+ }
}
pBindings->LEAVEREGISTRATIONS();