summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-01 22:56:00 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-08 22:52:30 +0200
commit0db8160a7958c306d7957bcd34ba6bfd3082b90b (patch)
tree8a679ee91cf1b68b8660565c8f3c684086e70663 /sfx2
parent7e350ac0674fad060a294dd132e368d560713005 (diff)
Convert SV_DECL_PTRARR_DEL(SfxVerbSlotArr_Impl) to std::vector
Change-Id: I06bdcdf6e6b7f159783ce7ab381b7b21f7db4a98
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/shell.cxx20
1 files changed, 13 insertions, 7 deletions
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index a9b3f5cfc67c..5ba4ad65f48a 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -61,9 +61,15 @@ DBG_NAME(SfxShell)
TYPEINIT0(SfxShell);
//====================================================================
-typedef SfxSlot* SfxSlotPtr;
-SV_DECL_PTRARR_DEL( SfxVerbSlotArr_Impl, SfxSlotPtr, 4 )
-SV_IMPL_PTRARR( SfxVerbSlotArr_Impl, SfxSlotPtr);
+class SfxVerbSlotArr_Impl : public std::vector<SfxSlot*>
+{
+public:
+ ~SfxVerbSlotArr_Impl()
+ {
+ for(const_iterator it = begin(); it != end(); ++it)
+ delete *it;
+ }
+};
using namespace com::sun::star;
@@ -979,7 +985,7 @@ void SfxShell::SetVerbs(const com::sun::star::uno::Sequence < com::sun::star::em
{
SfxBindings *pBindings =
pViewSh->GetViewFrame()->GetDispatcher()->GetBindings();
- sal_uInt16 nCount = pImp->aSlotArr.Count();
+ sal_uInt16 nCount = pImp->aSlotArr.size();
for (sal_uInt16 n1=0; n1<nCount ; n1++)
{
sal_uInt16 nId = SID_VERB_START + n1;
@@ -1013,16 +1019,16 @@ void SfxShell::SetVerbs(const com::sun::star::uno::Sequence < com::sun::star::em
pNewSlot->pFirstArgDef = 0;
pNewSlot->pUnoName = 0;
- if (pImp->aSlotArr.Count())
+ if (!pImp->aSlotArr.empty())
{
- SfxSlot *pSlot = (pImp->aSlotArr)[0];
+ SfxSlot *pSlot = pImp->aSlotArr[0];
pNewSlot->pNextSlot = pSlot->pNextSlot;
pSlot->pNextSlot = pNewSlot;
}
else
pNewSlot->pNextSlot = pNewSlot;
- pImp->aSlotArr.Insert(pNewSlot, (sal_uInt16) n);
+ pImp->aSlotArr.insert(pImp->aSlotArr.begin() + (sal_uInt16) n, pNewSlot);
}
pImp->aVerbList = aVerbs;