Kaydet (Commit) 0b784bd6 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Michael Stahl

Convert SV_DECL_PTRARR(SfxModuleArr_Impl) to std::vector

Change-Id: I905d17fbbda11199065237b396c52bacc481e414
üst 7f91d56e
...@@ -59,7 +59,7 @@ public: ...@@ -59,7 +59,7 @@ public:
}; };
class SfxModule; class SfxModule;
SV_DECL_PTRARR( SfxModuleArr_Impl, SfxModule*, 2 ) typedef ::std::vector<SfxModule*> SfxModuleArr_Impl;
class SfxFrame; class SfxFrame;
typedef ::std::vector<SfxFrame*> SfxFrameArr_Impl; typedef ::std::vector<SfxFrame*> SfxFrameArr_Impl;
......
...@@ -89,7 +89,8 @@ class StarBASIC; ...@@ -89,7 +89,8 @@ class StarBASIC;
class SfxWorkWindow; class SfxWorkWindow;
class SfxFilterMatcher; class SfxFilterMatcher;
class SfxModule; class SfxModule;
class SfxModuleArr_Impl; class SfxModule;
typedef ::std::vector<SfxModule*> SfxModuleArr_Impl;
class Window; class Window;
class INetURLObject; class INetURLObject;
struct SfxConstant; struct SfxConstant;
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include <sal/types.h> #include <sal/types.h>
#include <tools/fldunit.hxx> #include <tools/fldunit.hxx>
#include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Reference.hxx>
#include <vector>
class ImageList; class ImageList;
...@@ -43,7 +44,8 @@ class SfxBindings; ...@@ -43,7 +44,8 @@ class SfxBindings;
class SfxObjectFactory; class SfxObjectFactory;
class ModalDialog; class ModalDialog;
class SfxObjectFactory; class SfxObjectFactory;
class SfxModuleArr_Impl; class SfxModule;
typedef ::std::vector<SfxModule*> SfxModuleArr_Impl;
class SfxModule_Impl; class SfxModule_Impl;
class SfxSlotPool; class SfxSlotPool;
struct SfxChildWinContextFactory; struct SfxChildWinContextFactory;
......
...@@ -91,7 +91,6 @@ using namespace ::com::sun::star::container; ...@@ -91,7 +91,6 @@ using namespace ::com::sun::star::container;
SV_IMPL_PTRARR( SfxTbxCtrlFactArr_Impl, SfxTbxCtrlFactory* ); SV_IMPL_PTRARR( SfxTbxCtrlFactArr_Impl, SfxTbxCtrlFactory* );
SV_IMPL_PTRARR( SfxStbCtrlFactArr_Impl, SfxStbCtrlFactory* ); SV_IMPL_PTRARR( SfxStbCtrlFactArr_Impl, SfxStbCtrlFactory* );
SV_IMPL_PTRARR( SfxMenuCtrlFactArr_Impl, SfxMenuCtrlFactory* ); SV_IMPL_PTRARR( SfxMenuCtrlFactArr_Impl, SfxMenuCtrlFactory* );
SV_IMPL_PTRARR( SfxModuleArr_Impl, SfxModule* );
//=================================================================== //===================================================================
......
...@@ -144,7 +144,7 @@ void SfxModule::Construct_Impl() ...@@ -144,7 +144,7 @@ void SfxModule::Construct_Impl()
SfxApplication *pApp = SFX_APP(); SfxApplication *pApp = SFX_APP();
SfxModuleArr_Impl& rArr = GetModules_Impl(); SfxModuleArr_Impl& rArr = GetModules_Impl();
SfxModule* pPtr = (SfxModule*)this; SfxModule* pPtr = (SfxModule*)this;
rArr.C40_INSERT( SfxModule, pPtr, rArr.Count() ); rArr.push_back( pPtr );
pImpl = new SfxModule_Impl; pImpl = new SfxModule_Impl;
pImpl->pSlotPool = new SfxSlotPool( &pApp->GetAppSlotPool_Impl(), pResMgr ); pImpl->pSlotPool = new SfxSlotPool( &pApp->GetAppSlotPool_Impl(), pResMgr );
...@@ -170,11 +170,11 @@ SfxModule::~SfxModule() ...@@ -170,11 +170,11 @@ SfxModule::~SfxModule()
// The module will be destroyed before the Deinitialize, // The module will be destroyed before the Deinitialize,
// so remove from the array // so remove from the array
SfxModuleArr_Impl& rArr = GetModules_Impl(); SfxModuleArr_Impl& rArr = GetModules_Impl();
for( sal_uInt16 nPos = rArr.Count(); nPos--; ) for( sal_uInt16 nPos = rArr.size(); nPos--; )
{ {
if( rArr[ nPos ] == this ) if( rArr[ nPos ] == this )
{ {
rArr.Remove( nPos ); rArr.erase( rArr.begin() + nPos );
break; break;
} }
} }
...@@ -331,9 +331,9 @@ void SfxModule::DestroyModules_Impl() ...@@ -331,9 +331,9 @@ void SfxModule::DestroyModules_Impl()
if ( pModules ) if ( pModules )
{ {
SfxModuleArr_Impl& rModules = *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 pMod;
} }
delete pModules, pModules = 0; delete pModules, pModules = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment