diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-14 09:25:19 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-06-20 19:46:38 +0200 |
commit | 0b784bd6419643288066cb233c78b609d83048cc (patch) | |
tree | 05649c7dcae55d782aaee4d93ed0dfdf8917d00e | |
parent | 7f91d56e078048e2e0bc8f3edf1e47ff0b7f0d5a (diff) |
Convert SV_DECL_PTRARR(SfxModuleArr_Impl) to std::vector
Change-Id: I905d17fbbda11199065237b396c52bacc481e414
-rw-r--r-- | sfx2/inc/arrdecl.hxx | 2 | ||||
-rw-r--r-- | sfx2/inc/sfx2/app.hxx | 3 | ||||
-rw-r--r-- | sfx2/inc/sfx2/module.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/appmisc.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/appl/module.cxx | 10 |
5 files changed, 11 insertions, 9 deletions
diff --git a/sfx2/inc/arrdecl.hxx b/sfx2/inc/arrdecl.hxx index f8e4eb478226..45481f839d77 100644 --- a/sfx2/inc/arrdecl.hxx +++ b/sfx2/inc/arrdecl.hxx @@ -59,7 +59,7 @@ public: }; class SfxModule; -SV_DECL_PTRARR( SfxModuleArr_Impl, SfxModule*, 2 ) +typedef ::std::vector<SfxModule*> SfxModuleArr_Impl; class SfxFrame; typedef ::std::vector<SfxFrame*> SfxFrameArr_Impl; diff --git a/sfx2/inc/sfx2/app.hxx b/sfx2/inc/sfx2/app.hxx index 8cef64876815..8b26b4472b79 100644 --- a/sfx2/inc/sfx2/app.hxx +++ b/sfx2/inc/sfx2/app.hxx @@ -89,7 +89,8 @@ class StarBASIC; class SfxWorkWindow; class SfxFilterMatcher; class SfxModule; -class SfxModuleArr_Impl; +class SfxModule; +typedef ::std::vector<SfxModule*> SfxModuleArr_Impl; class Window; class INetURLObject; struct SfxConstant; diff --git a/sfx2/inc/sfx2/module.hxx b/sfx2/inc/sfx2/module.hxx index 98fff6619b36..dc4a5b093bca 100644 --- a/sfx2/inc/sfx2/module.hxx +++ b/sfx2/inc/sfx2/module.hxx @@ -36,6 +36,7 @@ #include <sal/types.h> #include <tools/fldunit.hxx> #include <com/sun/star/uno/Reference.hxx> +#include <vector> class ImageList; @@ -43,7 +44,8 @@ class SfxBindings; class SfxObjectFactory; class ModalDialog; class SfxObjectFactory; -class SfxModuleArr_Impl; +class SfxModule; +typedef ::std::vector<SfxModule*> SfxModuleArr_Impl; class SfxModule_Impl; class SfxSlotPool; struct SfxChildWinContextFactory; diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index 5599268ea6c7..814a55722d90 100644 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -91,7 +91,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* ); -SV_IMPL_PTRARR( SfxModuleArr_Impl, SfxModule* ); //=================================================================== diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index 5903b5aa8e04..73a7e0cff48d 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -144,7 +144,7 @@ void SfxModule::Construct_Impl() SfxApplication *pApp = SFX_APP(); SfxModuleArr_Impl& rArr = GetModules_Impl(); SfxModule* pPtr = (SfxModule*)this; - rArr.C40_INSERT( SfxModule, pPtr, rArr.Count() ); + rArr.push_back( pPtr ); pImpl = new SfxModule_Impl; pImpl->pSlotPool = new SfxSlotPool( &pApp->GetAppSlotPool_Impl(), pResMgr ); @@ -170,11 +170,11 @@ SfxModule::~SfxModule() // The module will be destroyed before the Deinitialize, // so remove from the array SfxModuleArr_Impl& rArr = GetModules_Impl(); - for( sal_uInt16 nPos = rArr.Count(); nPos--; ) + for( sal_uInt16 nPos = rArr.size(); nPos--; ) { if( rArr[ nPos ] == this ) { - rArr.Remove( nPos ); + rArr.erase( rArr.begin() + nPos ); break; } } @@ -331,9 +331,9 @@ void SfxModule::DestroyModules_Impl() if ( pModules ) { SfxModuleArr_Impl& rModules = *pModules; - for( sal_uInt16 nPos = rModules.Count(); nPos--; ) + for( sal_uInt16 nPos = rModules.size(); nPos--; ) { - SfxModule* pMod = rModules.GetObject(nPos); + SfxModule* pMod = rModules[nPos]; delete pMod; } delete pModules, pModules = 0; |