diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-14 11:05:49 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-20 19:46:39 +0200 |
commit | 59713265ece84a7775dfed209f4b42c53ec95a34 (patch) | |
tree | f5f8a27bf31bc0f4ff10dd6d3028b7244c02ab14 /sfx2 | |
parent | eb1204ef4439f86d14b0d0bfd8a8983cc840d7d8 (diff) |
Convert SV_DECL_PTRARR_DEL(SfxTbxCtrlFactArr_Impl) to std::vector
Change-Id: I2e80e17ed79e156bcfe379ddc5b11fd2cb2804d2
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/arrdecl.hxx | 7 | ||||
-rw-r--r-- | sfx2/source/appl/appmisc.cxx | 11 | ||||
-rw-r--r-- | sfx2/source/appl/appreg.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/module.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 4 |
5 files changed, 19 insertions, 11 deletions
diff --git a/sfx2/inc/arrdecl.hxx b/sfx2/inc/arrdecl.hxx index 6e5160481edc..64633faabe0a 100644 --- a/sfx2/inc/arrdecl.hxx +++ b/sfx2/inc/arrdecl.hxx @@ -43,7 +43,12 @@ class SfxViewShell; SV_DECL_PTRARR( SfxViewShellArr_Impl, SfxViewShell*, 4 ) struct SfxTbxCtrlFactory; -SV_DECL_PTRARR_DEL( SfxTbxCtrlFactArr_Impl, SfxTbxCtrlFactory*, 8 ) +class SfxTbxCtrlFactArr_Impl : public std::vector<SfxTbxCtrlFactory*> +{ +public: + // de-allocates child objects + ~SfxTbxCtrlFactArr_Impl(); +}; struct SfxStbCtrlFactory; class SfxStbCtrlFactArr_Impl : public std::vector<SfxStbCtrlFactory*> diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index eec9e802f7b4..1e57943d3942 100644 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -88,10 +88,6 @@ using namespace ::com::sun::star::container; //=================================================================== -SV_IMPL_PTRARR( SfxTbxCtrlFactArr_Impl, SfxTbxCtrlFactory* ); - -//=================================================================== - #define SfxApplication #include "sfxslots.hxx" @@ -297,4 +293,11 @@ SfxStbCtrlFactArr_Impl::~SfxStbCtrlFactArr_Impl() for( const_iterator it = begin(); it != end(); ++it ) delete *it; } + +SfxTbxCtrlFactArr_Impl::~SfxTbxCtrlFactArr_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 b20bfc1d3840..23d9e80cf574 100644 --- a/sfx2/source/appl/appreg.cxx +++ b/sfx2/source/appl/appreg.cxx @@ -84,7 +84,7 @@ void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFac } #ifdef DBG_UTIL - for ( sal_uInt16 n=0; n<pAppData_Impl->pTbxCtrlFac->Count(); n++ ) + for ( sal_uInt16 n=0; n<pAppData_Impl->pTbxCtrlFac->size(); n++ ) { SfxTbxCtrlFactory *pF = (*pAppData_Impl->pTbxCtrlFac)[n]; if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && @@ -95,7 +95,7 @@ void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFac } #endif - pAppData_Impl->pTbxCtrlFac->C40_INSERT( SfxTbxCtrlFactory, pFact, pAppData_Impl->pTbxCtrlFac->Count() ); + pAppData_Impl->pTbxCtrlFac->push_back( pFact ); } //-------------------------------------------------------------------- diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index c1a6c363f71e..cfa7b1362e1e 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -223,7 +223,7 @@ void SfxModule::RegisterToolBoxControl( SfxTbxCtrlFactory *pFact ) pImpl->pTbxCtrlFac = new SfxTbxCtrlFactArr_Impl; #ifdef DBG_UTIL - for ( sal_uInt16 n=0; n<pImpl->pTbxCtrlFac->Count(); n++ ) + for ( sal_uInt16 n=0; n<pImpl->pTbxCtrlFac->size(); n++ ) { SfxTbxCtrlFactory *pF = (*pImpl->pTbxCtrlFac)[n]; if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId && @@ -234,7 +234,7 @@ void SfxModule::RegisterToolBoxControl( SfxTbxCtrlFactory *pFact ) } #endif - pImpl->pTbxCtrlFac->C40_INSERT( SfxTbxCtrlFactory, pFact, pImpl->pTbxCtrlFac->Count() ); + pImpl->pTbxCtrlFac->push_back( pFact ); } //------------------------------------------------------------------------- diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 1e458ed912d3..478addb99c7d 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -337,7 +337,7 @@ SfxToolBoxControl* SfxToolBoxControl::CreateControl( sal_uInt16 nSlotId, sal_uIn { SfxTbxCtrlFactArr_Impl &rFactories = *pFactories; sal_uInt16 nFactory; - const sal_uInt16 nCount = rFactories.Count(); + const sal_uInt16 nCount = rFactories.size(); // search for a factory with the given slot id for( nFactory = 0; nFactory < nCount; ++nFactory ) @@ -364,7 +364,7 @@ SfxToolBoxControl* SfxToolBoxControl::CreateControl( sal_uInt16 nSlotId, sal_uIn SfxTbxCtrlFactArr_Impl &rFactories = pApp->GetTbxCtrlFactories_Impl(); sal_uInt16 nFactory; - const sal_uInt16 nCount = rFactories.Count(); + const sal_uInt16 nCount = rFactories.size(); for( nFactory = 0; nFactory < nCount; ++nFactory ) if( (rFactories[nFactory]->nTypeId == aSlotType) && (rFactories[nFactory]->nSlotId == nSlotId) ) |