diff options
author | August Sodora <augsod@gmail.com> | 2012-01-20 00:43:05 -0500 |
---|---|---|
committer | August Sodora <augsod@gmail.com> | 2012-01-20 13:47:57 -0500 |
commit | 94d4764a42f8f38b884bb8960791d80ac876b786 (patch) | |
tree | 1a60efdd1d99827f702ddc6e5d789b0358d84396 /sfx2 | |
parent | 00081bb2fdf263d784082fb202d7802418ac7666 (diff) |
SV_DECL_PTRARR->std::vector
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/inc/virtmenu.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/menu/virtmenu.cxx | 25 |
2 files changed, 10 insertions, 19 deletions
diff --git a/sfx2/source/inc/virtmenu.hxx b/sfx2/source/inc/virtmenu.hxx index cc7cb26ffdc4..998fe66ce7b6 100644 --- a/sfx2/source/inc/virtmenu.hxx +++ b/sfx2/source/inc/virtmenu.hxx @@ -28,8 +28,6 @@ #ifndef _SFXVIRTMENU_HXX #define _SFXVIRTMENU_HXX - -#include <svl/svarray.hxx> #include <sfx2/mnuitem.hxx> #include "mnucfga.hxx" @@ -37,7 +35,7 @@ class SfxBindings; class Timer; class SfxMenuImageControl_Impl; -SV_DECL_PTRARR_DEL( SfxMenuCtrlArr_Impl, SfxMenuControl*, 2, 2 ) +typedef std::vector<SfxMenuControl*> SfxMenuCtrlArr_Impl; class SAL_DLLPUBLIC_EXPORT SfxVirtualMenu { diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx index 28fd98c3b355..c62dfd570013 100644 --- a/sfx2/source/menu/virtmenu.cxx +++ b/sfx2/source/menu/virtmenu.cxx @@ -66,14 +66,9 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::uno; -//========================================================================= - DBG_NAME(SfxVirtualMenu) -//========================================================================= - typedef SfxMenuControl* SfxMenuControlPtr; -SV_IMPL_PTRARR(SfxMenuCtrlArr_Impl, SfxMenuControlPtr); class SfxMenuImageControl_Impl : public SfxControllerItem { @@ -401,7 +396,7 @@ void SfxVirtualMenu::CreateFromSVMenu() pPopup = 0; SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl(); - rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count() ); + rCtrlArr.push_back(pMnuCtrl); (pItems+nPos)->Bind( 0, nSlotId, sItemText, *pBindings); pMnuCtrl->Bind( this, nSlotId, sItemText, *pBindings); @@ -444,7 +439,7 @@ void SfxVirtualMenu::CreateFromSVMenu() if ( pMnuCtrl ) { SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl(); - rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count()); + rCtrlArr.push_back(pMnuCtrl); (pItems+nPos)->Bind( 0, nSlotId, sItemText, *pBindings); } } @@ -456,7 +451,7 @@ void SfxVirtualMenu::CreateFromSVMenu() if ( pMnuCtrl ) { SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl(); - rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count()); + rCtrlArr.push_back(pMnuCtrl); (pItems+nPos)->Bind( 0, nSlotId, sItemText, *pBindings); } else @@ -736,12 +731,11 @@ void SfxVirtualMenu::BindControllers() } SfxMenuCtrlArr_Impl& rCtrlArr = GetAppCtrl_Impl(); - for ( nPos=0; nPos<rCtrlArr.Count(); nPos++ ) + for(SfxMenuCtrlArr_Impl::const_iterator i = rCtrlArr.begin(); i != rCtrlArr.end(); ++i) { - SfxMenuControl* pCtrl = rCtrlArr[nPos]; - sal_uInt16 nSlotId = pCtrl->GetId(); + sal_uInt16 nSlotId = (*i)->GetId(); if ( !pSVMenu->GetItemCommand(nSlotId).Len() ) - pCtrl->ReBind(); + (*i)->ReBind(); } pBindings->LEAVEREGISTRATIONS(); @@ -761,12 +755,11 @@ void SfxVirtualMenu::UnbindControllers() } SfxMenuCtrlArr_Impl& rCtrlArr = GetAppCtrl_Impl(); - for ( nPos=0; nPos<rCtrlArr.Count(); nPos++ ) + for(SfxMenuCtrlArr_Impl::const_iterator i = rCtrlArr.begin(); i != rCtrlArr.end(); ++i) { - SfxMenuControl* pCtrl = rCtrlArr[nPos]; - if ( pCtrl->IsBound() ) + if((*i)->IsBound()) // UnoController is not binded! - pCtrl->UnBind(); + (*i)->UnBind(); } pBindings->LEAVEREGISTRATIONS(); |