summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-06-14 10:42:58 +0200
committerMichael Stahl <mstahl@redhat.com>2012-06-20 19:46:38 +0200
commita1cedf2b1ed350687e5369707b715b41ca7808e3 (patch)
treefba3d9f1442d6493067eb80e834ce0958f61e11a /sfx2
parent0b784bd6419643288066cb233c78b609d83048cc (diff)
Convert SV_DECL_PTRARR_DEL(SfxMenuCtrlFactArr_Impl) to std::vector
Change-Id: I65b6f6e1f615c8f6e778b10945c60a28875d88ba
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/arrdecl.hxx8
-rw-r--r--sfx2/source/appl/appmisc.cxx8
-rw-r--r--sfx2/source/appl/appreg.cxx4
-rw-r--r--sfx2/source/appl/module.cxx4
-rw-r--r--sfx2/source/menu/mnuitem.cxx4
5 files changed, 20 insertions, 8 deletions
diff --git a/sfx2/inc/arrdecl.hxx b/sfx2/inc/arrdecl.hxx
index 45481f839d77..94892a75b61c 100644
--- a/sfx2/inc/arrdecl.hxx
+++ b/sfx2/inc/arrdecl.hxx
@@ -31,6 +31,7 @@
#include <svl/svarray.hxx>
#include <sfx2/minarray.hxx>
#include <vector>
+#include <boost/ptr_container/ptr_vector.hpp>
class SfxObjectShell;
SV_DECL_PTRARR( SfxObjectShellArr_Impl, SfxObjectShell*, 4 )
@@ -48,7 +49,12 @@ struct SfxStbCtrlFactory;
SV_DECL_PTRARR_DEL( SfxStbCtrlFactArr_Impl, SfxStbCtrlFactory*, 8 )
struct SfxMenuCtrlFactory;
-SV_DECL_PTRARR_DEL( SfxMenuCtrlFactArr_Impl, SfxMenuCtrlFactory*, 2 )
+class SfxMenuCtrlFactArr_Impl : public std::vector<SfxMenuCtrlFactory*>
+{
+public:
+ // de-allocates child objects
+ ~SfxMenuCtrlFactArr_Impl();
+};
struct SfxChildWinFactory;
class SfxChildWinFactArr_Impl : public std::vector<SfxChildWinFactory*>
diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx
index 814a55722d90..9a42ea4323dc 100644
--- a/sfx2/source/appl/appmisc.cxx
+++ b/sfx2/source/appl/appmisc.cxx
@@ -90,7 +90,6 @@ using namespace ::com::sun::star::container;
SV_IMPL_PTRARR( SfxTbxCtrlFactArr_Impl, SfxTbxCtrlFactory* );
SV_IMPL_PTRARR( SfxStbCtrlFactArr_Impl, SfxStbCtrlFactory* );
-SV_IMPL_PTRARR( SfxMenuCtrlFactArr_Impl, SfxMenuCtrlFactory* );
//===================================================================
@@ -287,4 +286,11 @@ SfxChildWinFactArr_Impl::~SfxChildWinFactArr_Impl()
for( const_iterator it = begin(); it != end(); ++it )
delete *it;
}
+
+SfxMenuCtrlFactArr_Impl::~SfxMenuCtrlFactArr_Impl()
+{
+ for( const_iterator it = begin(); it != end(); ++it )
+ delete *it;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx
index 070bf9f92494..01c06e12fbe2 100644
--- a/sfx2/source/appl/appreg.cxx
+++ b/sfx2/source/appl/appreg.cxx
@@ -134,7 +134,7 @@ void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFacto
}
#ifdef DBG_UTIL
- for ( sal_uInt16 n=0; n<pAppData_Impl->pMenuCtrlFac->Count(); n++ )
+ for ( sal_uInt16 n=0; n<pAppData_Impl->pMenuCtrlFac->size(); n++ )
{
SfxMenuCtrlFactory *pF = (*pAppData_Impl->pMenuCtrlFac)[n];
if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
@@ -145,7 +145,7 @@ void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFacto
}
#endif
- pAppData_Impl->pMenuCtrlFac->C40_INSERT( SfxMenuCtrlFactory, pFact, pAppData_Impl->pMenuCtrlFac->Count() );
+ pAppData_Impl->pMenuCtrlFac->push_back( pFact );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index 73a7e0cff48d..f667725e2cef 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -267,7 +267,7 @@ void SfxModule::RegisterMenuControl( SfxMenuCtrlFactory *pFact )
pImpl->pMenuCtrlFac = new SfxMenuCtrlFactArr_Impl;
#ifdef DBG_UTIL
- for ( sal_uInt16 n=0; n<pImpl->pMenuCtrlFac->Count(); n++ )
+ for ( sal_uInt16 n=0; n<pImpl->pMenuCtrlFac->size(); n++ )
{
SfxMenuCtrlFactory *pF = (*pImpl->pMenuCtrlFac)[n];
if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
@@ -278,7 +278,7 @@ void SfxModule::RegisterMenuControl( SfxMenuCtrlFactory *pFact )
}
#endif
- pImpl->pMenuCtrlFac->C40_INSERT( SfxMenuCtrlFactory, pFact, pImpl->pMenuCtrlFac->Count() );
+ pImpl->pMenuCtrlFac->push_back( pFact );
}
//-------------------------------------------------------------------------
diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx
index 58d5de148c4a..6cd43caf645c 100644
--- a/sfx2/source/menu/mnuitem.cxx
+++ b/sfx2/source/menu/mnuitem.cxx
@@ -271,7 +271,7 @@ SfxMenuControl* SfxMenuControl::CreateControl( sal_uInt16 nId, Menu &rMenu, SfxB
if ( pFactories )
{
SfxMenuCtrlFactArr_Impl &rFactories = *pFactories;
- for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
+ for ( sal_uInt16 nFactory = 0; nFactory < rFactories.size(); ++nFactory )
if ( rFactories[nFactory]->nTypeId == aSlotType &&
( ( rFactories[nFactory]->nSlotId == 0 ) ||
( rFactories[nFactory]->nSlotId == nId) ) )
@@ -281,7 +281,7 @@ SfxMenuControl* SfxMenuControl::CreateControl( sal_uInt16 nId, Menu &rMenu, SfxB
SfxMenuCtrlFactArr_Impl &rFactories = pApp->GetMenuCtrlFactories_Impl();
- for ( sal_uInt16 nFactory = 0; nFactory < rFactories.Count(); ++nFactory )
+ for ( sal_uInt16 nFactory = 0; nFactory < rFactories.size(); ++nFactory )
if ( rFactories[nFactory]->nTypeId == aSlotType &&
( ( rFactories[nFactory]->nSlotId == 0 ) ||
( rFactories[nFactory]->nSlotId == nId) ) )