From eb1204ef4439f86d14b0d0bfd8a8983cc840d7d8 Mon Sep 17 00:00:00 2001
From: Noel Grandin <noel@peralex.com>
Date: Thu, 14 Jun 2012 10:58:29 +0200
Subject: Convert SV_DECL_PTRARR_DEL(SfxStbCtrlFactArr_Impl) to std::vector

Change-Id: Id2f35eba75628ed1bc1080e9671378e461e84233
---
 sfx2/inc/arrdecl.hxx            | 7 ++++++-
 sfx2/source/appl/appmisc.cxx    | 6 +++++-
 sfx2/source/appl/appreg.cxx     | 4 ++--
 sfx2/source/appl/module.cxx     | 4 ++--
 sfx2/source/statbar/stbitem.cxx | 4 ++--
 5 files changed, 17 insertions(+), 8 deletions(-)

(limited to 'sfx2')

diff --git a/sfx2/inc/arrdecl.hxx b/sfx2/inc/arrdecl.hxx
index 94892a75b61c..6e5160481edc 100644
--- a/sfx2/inc/arrdecl.hxx
+++ b/sfx2/inc/arrdecl.hxx
@@ -46,7 +46,12 @@ struct SfxTbxCtrlFactory;
 SV_DECL_PTRARR_DEL( SfxTbxCtrlFactArr_Impl, SfxTbxCtrlFactory*, 8 )
 
 struct SfxStbCtrlFactory;
-SV_DECL_PTRARR_DEL( SfxStbCtrlFactArr_Impl, SfxStbCtrlFactory*, 8 )
+class SfxStbCtrlFactArr_Impl : public std::vector<SfxStbCtrlFactory*>
+{
+public:
+    // de-allocates child objects
+    ~SfxStbCtrlFactArr_Impl();
+};
 
 struct SfxMenuCtrlFactory;
 class SfxMenuCtrlFactArr_Impl : public std::vector<SfxMenuCtrlFactory*>
diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx
index 9a42ea4323dc..eec9e802f7b4 100644
--- a/sfx2/source/appl/appmisc.cxx
+++ b/sfx2/source/appl/appmisc.cxx
@@ -89,7 +89,6 @@ using namespace ::com::sun::star::container;
 //===================================================================
 
 SV_IMPL_PTRARR( SfxTbxCtrlFactArr_Impl, SfxTbxCtrlFactory* );
-SV_IMPL_PTRARR( SfxStbCtrlFactArr_Impl, SfxStbCtrlFactory* );
 
 //===================================================================
 
@@ -293,4 +292,9 @@ SfxMenuCtrlFactArr_Impl::~SfxMenuCtrlFactArr_Impl()
         delete *it;
 }
 
+SfxStbCtrlFactArr_Impl::~SfxStbCtrlFactArr_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 01c06e12fbe2..b20bfc1d3840 100644
--- a/sfx2/source/appl/appreg.cxx
+++ b/sfx2/source/appl/appreg.cxx
@@ -109,7 +109,7 @@ void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlF
     }
 
 #ifdef DBG_UTIL
-    for ( sal_uInt16 n=0; n<pAppData_Impl->pStbCtrlFac->Count(); n++ )
+    for ( sal_uInt16 n=0; n<pAppData_Impl->pStbCtrlFac->size(); n++ )
     {
         SfxStbCtrlFactory *pF = (*pAppData_Impl->pStbCtrlFac)[n];
         if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
@@ -120,7 +120,7 @@ void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlF
     }
 #endif
 
-    pAppData_Impl->pStbCtrlFac->C40_INSERT( SfxStbCtrlFactory, pFact, pAppData_Impl->pStbCtrlFac->Count() );
+    pAppData_Impl->pStbCtrlFac->push_back( pFact );
 }
 
 //--------------------------------------------------------------------
diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx
index f667725e2cef..c1a6c363f71e 100644
--- a/sfx2/source/appl/module.cxx
+++ b/sfx2/source/appl/module.cxx
@@ -245,7 +245,7 @@ void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact )
         pImpl->pStbCtrlFac = new SfxStbCtrlFactArr_Impl;
 
 #ifdef DBG_UTIL
-    for ( sal_uInt16 n=0; n<pImpl->pStbCtrlFac->Count(); n++ )
+    for ( sal_uInt16 n=0; n<pImpl->pStbCtrlFac->size(); n++ )
     {
         SfxStbCtrlFactory *pF = (*pImpl->pStbCtrlFac)[n];
         if ( pF->nTypeId && pF->nTypeId == pFact->nTypeId &&
@@ -256,7 +256,7 @@ void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact )
     }
 #endif
 
-    pImpl->pStbCtrlFac->C40_INSERT( SfxStbCtrlFactory, pFact, pImpl->pStbCtrlFac->Count() );
+    pImpl->pStbCtrlFac->push_back( pFact );
 }
 
 //-------------------------------------------------------------------------
diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx
index 9c993eaea2ad..874b99de9030 100644
--- a/sfx2/source/statbar/stbitem.cxx
+++ b/sfx2/source/statbar/stbitem.cxx
@@ -653,7 +653,7 @@ SfxStatusBarControl* SfxStatusBarControl::CreateControl
             if ( pFactories )
             {
                 SfxStbCtrlFactArr_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 == nSlotID) ) )
@@ -662,7 +662,7 @@ SfxStatusBarControl* SfxStatusBarControl::CreateControl
         }
 
         SfxStbCtrlFactArr_Impl &rFactories = pApp->GetStbCtrlFactories_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 == nSlotID) ) )
-- 
cgit