[Libreoffice-commits] .: 8 commits - sfx2/inc sfx2/source

August Sodora augsod at kemper.freedesktop.org
Fri Jan 20 10:51:43 PST 2012


 sfx2/inc/arrdecl.hxx            |    4 --
 sfx2/inc/sfx2/frmdescr.hxx      |    2 -
 sfx2/inc/sfx2/msgpool.hxx       |    9 ++----
 sfx2/source/appl/appdata.cxx    |    1 
 sfx2/source/appl/appquit.cxx    |    1 
 sfx2/source/control/msgpool.cxx |   54 +++++++++++++++++-----------------------
 sfx2/source/inc/appdata.hxx     |    9 ------
 sfx2/source/inc/virtmenu.hxx    |    4 --
 sfx2/source/menu/mnumgr.cxx     |    7 -----
 sfx2/source/menu/virtmenu.cxx   |   25 ++++++------------
 sfx2/source/view/viewimp.hxx    |    6 ----
 sfx2/source/view/viewsh.cxx     |   34 +++++++++++--------------
 12 files changed, 53 insertions(+), 103 deletions(-)

New commits:
commit 21ec8d068f457f222fa170eed296415717716a14
Author: August Sodora <augsod at gmail.com>
Date:   Fri Jan 20 01:25:10 2012 -0500

    Remove unused DECL_PTRSTACK

diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx
index e9d7cf8..8b87238 100644
--- a/sfx2/source/menu/mnumgr.cxx
+++ b/sfx2/source/menu/mnumgr.cxx
@@ -76,7 +76,6 @@
 #include <sfx2/objface.hxx>
 #include "thessubmenu.hxx"
 
-
 static const sal_uInt16 nCompatVersion = 4;
 static const sal_uInt16 nVersion = 5;
 
@@ -85,12 +84,6 @@ PopupMenu * SfxPopupMenuManager::pStaticThesSubMenu = NULL;
 
 using namespace com::sun::star;
 
-//=========================================================================
-
-DECL_PTRSTACK(SfxMenuCfgItemArrStack, SfxMenuCfgItemArr*, 4, 4 );
-
-//-------------------------------------------------------------------------
-
 void TryToHideDisabledEntries_Impl( Menu* pMenu )
 {
     DBG_ASSERT( pMenu, "invalid menu" );
commit ee0d6e3ab040ddd2ce1cd73945ee44da69201ca4
Author: August Sodora <augsod at gmail.com>
Date:   Fri Jan 20 01:23:16 2012 -0500

    DECL_PTRARRAY->std::vector

diff --git a/sfx2/inc/sfx2/msgpool.hxx b/sfx2/inc/sfx2/msgpool.hxx
index 0c7eab1..35d4be6 100644
--- a/sfx2/inc/sfx2/msgpool.hxx
+++ b/sfx2/inc/sfx2/msgpool.hxx
@@ -40,9 +40,10 @@
 
 class SfxInterface;
 class SfxSlot;
-class SfxSlotTypeArr_Impl;
+class SfxSlotType_Impl;
 
 typedef std::basic_string< sal_uInt16 > SfxSlotGroupArr_Impl;
+typedef std::vector<SfxSlotType_Impl*> SfxSlotTypeArr_Impl;
 typedef std::vector<SfxInterface*> SfxInterfaceArr_Impl;
 
 class SFX2_DLLPUBLIC SfxSlotPool
diff --git a/sfx2/source/control/msgpool.cxx b/sfx2/source/control/msgpool.cxx
index 9201f86..f49de94 100644
--- a/sfx2/source/control/msgpool.cxx
+++ b/sfx2/source/control/msgpool.cxx
@@ -43,7 +43,6 @@
 
 #include <sfx2/sfx.hrc>
 
-
 struct SfxSlotType_Impl
 {
     sal_uInt16  nId;
@@ -54,9 +53,6 @@ struct SfxSlotType_Impl
     {}
 };
 
-DECL_PTRARRAY(SfxSlotTypeArr_Impl, SfxSlotType_Impl*, 8, 8)
-
-
 SfxSlotPool::SfxSlotPool( SfxSlotPool *pParent, ResMgr* pResManager )
  : _pGroups(0)
  , _pTypes(0)
@@ -82,8 +78,8 @@ SfxSlotPool::~SfxSlotPool()
     delete _pGroups;
     if ( _pTypes )
     {
-        for ( sal_uInt16 n =_pTypes->Count(); n--; )
-            delete _pTypes->GetObject(n);
+        for(sal_uInt16 n = 0; n < _pTypes->size(); ++n)
+            delete (*_pTypes)[n];
         delete _pTypes;
     }
 }
commit 33e9d339224f2443bc5a69af814a0311d5a2ec7b
Author: August Sodora <augsod at gmail.com>
Date:   Fri Jan 20 01:18:22 2012 -0500

    DECL_PTRARRAY->std::vector

diff --git a/sfx2/inc/sfx2/msgpool.hxx b/sfx2/inc/sfx2/msgpool.hxx
index 425ecd7..0c7eab1 100644
--- a/sfx2/inc/sfx2/msgpool.hxx
+++ b/sfx2/inc/sfx2/msgpool.hxx
@@ -40,12 +40,10 @@
 
 class SfxInterface;
 class SfxSlot;
-class SfxInterfaceArr_Impl;
 class SfxSlotTypeArr_Impl;
 
 typedef std::basic_string< sal_uInt16 > SfxSlotGroupArr_Impl;
-
-//=========================================================================
+typedef std::vector<SfxInterface*> SfxInterfaceArr_Impl;
 
 class SFX2_DLLPUBLIC SfxSlotPool
 {
diff --git a/sfx2/source/control/msgpool.cxx b/sfx2/source/control/msgpool.cxx
index 9667d72..9201f86 100644
--- a/sfx2/source/control/msgpool.cxx
+++ b/sfx2/source/control/msgpool.cxx
@@ -43,7 +43,6 @@
 
 #include <sfx2/sfx.hrc>
 
-//====================================================================
 
 struct SfxSlotType_Impl
 {
@@ -55,10 +54,8 @@ struct SfxSlotType_Impl
     {}
 };
 
-DECL_PTRARRAY(SfxInterfaceArr_Impl, SfxInterface*, 6, 3)
 DECL_PTRARRAY(SfxSlotTypeArr_Impl, SfxSlotType_Impl*, 8, 8)
 
-//====================================================================
 
 SfxSlotPool::SfxSlotPool( SfxSlotPool *pParent, ResMgr* pResManager )
  : _pGroups(0)
@@ -97,13 +94,13 @@ SfxSlotPool::~SfxSlotPool()
 void SfxSlotPool::RegisterInterface( SfxInterface& rInterface )
 {
     // add to the list of SfxObjectInterface instances
-    if ( _pInterfaces == 0 )
+    if ( _pInterfaces == NULL )
         _pInterfaces = new SfxInterfaceArr_Impl;
-    _pInterfaces->Append(&rInterface);
+    _pInterfaces->push_back(&rInterface);
 
     // Stop at a (single) Null-slot (for syntactic reasons the interfaces
     // always contain at least one slot)
-    if ( rInterface.Count() == 1 && !rInterface[0]->nSlotId )
+    if ( rInterface.Count() != 0 && !rInterface[0]->nSlotId )
         return;
 
     // possibly add Interface-id and group-ids of funcs to the list of groups
@@ -120,7 +117,7 @@ void SfxSlotPool::RegisterInterface( SfxInterface& rInterface )
 
     if ( !_pTypes )
         _pTypes = new SfxSlotTypeArr_Impl;
-    for ( sal_uInt16 nFunc = 0; nFunc < rInterface.Count(); ++nFunc )
+    for ( size_t nFunc = 0; nFunc < rInterface.Count(); ++nFunc )
     {
         SfxSlot *pDef = rInterface[nFunc];
         if ( pDef->GetGroupId() && /* pDef->GetGroupId() != GID_INTERN && */
@@ -149,21 +146,21 @@ void SfxSlotPool::ReleaseInterface( SfxInterface& rInterface )
 {
     DBG_ASSERT( _pInterfaces, "releasing SfxInterface, but there are none" );
     // remove from the list of SfxInterface instances
-    _pInterfaces->Remove(&rInterface);
+    SfxInterfaceArr_Impl::iterator i = std::find(_pInterfaces->begin(), _pInterfaces->end(), &rInterface);
+    if(i != _pInterfaces->end())
+        _pInterfaces->erase(i);
 }
 
-//--------------------------------------------------------------------
-
 // get the first SfxMessage for a special Id (e.g. for getting check-mode)
 
 const SfxSlot* SfxSlotPool::GetSlot( sal_uInt16 nId )
 {
-    DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" );
+    DBG_ASSERT( _pInterfaces != NULL, "no Interfaces registered" );
 
     // First, search their own interfaces
-    for ( sal_uInt16 nInterf = 0; nInterf < _pInterfaces->Count(); ++nInterf )
+    for ( sal_uInt16 nInterf = 0; nInterf < _pInterfaces->size(); ++nInterf )
     {
-        const SfxSlot *pDef = _pInterfaces->GetObject(nInterf)->GetSlot(nId);
+        const SfxSlot *pDef = ((*_pInterfaces)[nInterf])->GetSlot(nId);
         if ( pDef )
             return pDef;
     }
@@ -178,7 +175,7 @@ const SfxSlot* SfxSlotPool::GetSlot( sal_uInt16 nId )
 
 String SfxSlotPool::SeekGroup( sal_uInt16 nNo )
 {
-    DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" );
+    DBG_ASSERT( _pInterfaces != NULL, "no Interfaces registered" );
 
     // if the group exists, use it
     if ( _pGroups && nNo < _pGroups->size() )
@@ -231,10 +228,10 @@ sal_uInt16 SfxSlotPool::GetGroupCount()
 
 const SfxSlot* SfxSlotPool::SeekSlot( sal_uInt16 nStartInterface )
 {
-    DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" );
+    DBG_ASSERT( _pInterfaces != NULL, "no Interfaces registered" );
 
     // The numbering starts at the interfaces of the parent pool
-    sal_uInt16 nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0;
+    sal_uInt16 nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->size() : 0;
 
     // have reached the end of the Parent-Pools?
     if ( nStartInterface < nFirstInterface &&
@@ -250,7 +247,7 @@ const SfxSlot* SfxSlotPool::SeekSlot( sal_uInt16 nStartInterface )
     }
 
     // find the first func-def with the current group id
-    sal_uInt16 nCount = _pInterfaces->Count() + nFirstInterface;
+    sal_uInt16 nCount = _pInterfaces->size() + nFirstInterface;
     for ( _nCurInterface = nStartInterface;
             _nCurInterface < nCount;
           ++_nCurInterface )
@@ -274,10 +271,10 @@ const SfxSlot* SfxSlotPool::SeekSlot( sal_uInt16 nStartInterface )
 
 const SfxSlot* SfxSlotPool::NextSlot()
 {
-    DBG_ASSERT( _pInterfaces != 0, "no Interfaces registered" );
+    DBG_ASSERT( _pInterfaces != NULL, "no Interfaces registered" );
 
     // The numbering starts at the interfaces of the parent pool
-    sal_uInt16 nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0;
+    sal_uInt16 nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->size() : 0;
 
     if ( _nCurInterface < nFirstInterface && _nCurGroup >= _pParentPool->_pGroups->size() )
         _nCurInterface = nFirstInterface;
@@ -296,7 +293,7 @@ const SfxSlot* SfxSlotPool::NextSlot()
 
     sal_uInt16 nInterface = _nCurInterface - nFirstInterface;
     // possibly we are already at the end
-    if ( nInterface >= _pInterfaces->Count() )
+    if ( nInterface >= _pInterfaces->size() )
         return 0;
 
     // look for further matching func-defs within the same Interface
@@ -319,7 +316,7 @@ const SfxSlot* SfxSlotPool::NextSlot()
 SfxInterface* SfxSlotPool::FirstInterface()
 {
     _nCurInterface = 0;
-    if ( !_pInterfaces || !_pInterfaces->Count() )
+    if ( !_pInterfaces || !_pInterfaces->size() )
         return 0;
     return _pParentPool ? _pParentPool->FirstInterface() : (*_pInterfaces)[0];
 }
@@ -330,17 +327,17 @@ SfxInterface* SfxSlotPool::FirstInterface()
 SfxInterface* SfxSlotPool::NextInterface()
 {
     _nCurInterface++;
-    sal_uInt16 nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->Count() : 0;
+    sal_uInt16 nFirstInterface = _pParentPool ? _pParentPool->_pInterfaces->size() : 0;
     if ( _nCurInterface < nFirstInterface )
         return (*_pParentPool->_pInterfaces)[_nCurInterface];
     sal_uInt16 nInterface = _nCurInterface - nFirstInterface;
-    return nInterface < _pInterfaces->Count() ? (*_pInterfaces)[nInterface] : 0;
+    return nInterface < _pInterfaces->size() ? (*_pInterfaces)[nInterface] : 0;
 }
 
 const SfxSlot* SfxSlotPool::GetUnoSlot( const String& rName )
 {
     const SfxSlot *pSlot = NULL;
-    for ( sal_uInt16 nInterface=0; nInterface<_pInterfaces->Count(); nInterface++ )
+    for ( sal_uInt16 nInterface=0; nInterface<_pInterfaces->size(); ++nInterface )
     {
         pSlot = (*_pInterfaces)[nInterface]->GetSlot( rName );
         if ( pSlot )
commit 2b8817ad5958cd4b975d10f53d0c2c6aabd3b784
Author: August Sodora <augsod at gmail.com>
Date:   Fri Jan 20 01:03:29 2012 -0500

    Remove unused SV_DECL_PTRARR

diff --git a/sfx2/inc/sfx2/frmdescr.hxx b/sfx2/inc/sfx2/frmdescr.hxx
index beb4085..e271a5e 100644
--- a/sfx2/inc/sfx2/frmdescr.hxx
+++ b/sfx2/inc/sfx2/frmdescr.hxx
@@ -42,8 +42,6 @@ class SvStream;
 struct SfxFrameDescriptor_Impl;
 class SfxFrameDescriptor;
 class Wallpaper;
-typedef SfxFrameDescriptor* SfxFrameDescriptorPtr;
-SV_DECL_PTRARR(SfxFramesArr, SfxFrameDescriptorPtr, 4, 2)
 
 //===========================================================================
 // The SfxFrame descriptors build a recursive structure, that covers all the
commit cd7bd2ff39fbb35121d34d1a3319587cce1a96b3
Author: August Sodora <augsod at gmail.com>
Date:   Fri Jan 20 01:01:41 2012 -0500

    Remove unused SV_DECL_PTRARR

diff --git a/sfx2/inc/arrdecl.hxx b/sfx2/inc/arrdecl.hxx
index 2d33577..2bbd34a 100644
--- a/sfx2/inc/arrdecl.hxx
+++ b/sfx2/inc/arrdecl.hxx
@@ -73,10 +73,6 @@ struct SfxExternalLib_Impl;
 typedef SfxExternalLib_Impl* SfxExternalLibPtr;
 SV_DECL_PTRARR_DEL( SfxExternalLibArr_Impl, SfxExternalLibPtr, 2, 2 )
 
-class SfxSlot;
-typedef SfxSlot* SfxSlotPtr;
-SV_DECL_PTRARR( SfxSlotArr_Impl, SfxSlotPtr, 20, 20 )
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/inc/sfx2/msgpool.hxx b/sfx2/inc/sfx2/msgpool.hxx
index 41de485..425ecd7 100644
--- a/sfx2/inc/sfx2/msgpool.hxx
+++ b/sfx2/inc/sfx2/msgpool.hxx
@@ -42,7 +42,6 @@ class SfxInterface;
 class SfxSlot;
 class SfxInterfaceArr_Impl;
 class SfxSlotTypeArr_Impl;
-class SfxSlotArr_Impl;
 
 typedef std::basic_string< sal_uInt16 > SfxSlotGroupArr_Impl;
 
@@ -58,7 +57,6 @@ class SFX2_DLLPUBLIC SfxSlotPool
     sal_uInt16                      _nCurGroup;
     sal_uInt16                      _nCurInterface;
     sal_uInt16                      _nCurMsg;
-    SfxSlotArr_Impl*            _pUnoSlots;
 
 private:
     const SfxSlot* SeekSlot( sal_uInt16 nObject );
diff --git a/sfx2/source/control/msgpool.cxx b/sfx2/source/control/msgpool.cxx
index c9afd98..9667d72 100644
--- a/sfx2/source/control/msgpool.cxx
+++ b/sfx2/source/control/msgpool.cxx
@@ -69,7 +69,6 @@ SfxSlotPool::SfxSlotPool( SfxSlotPool *pParent, ResMgr* pResManager )
  , _nCurGroup(0)
  , _nCurInterface(0)
  , _nCurMsg(0)
- , _pUnoSlots( 0 )
 {
     if ( !_pResMgr )
         _pResMgr = SfxApplication::GetOrCreate()->GetOffResManager_Impl();
commit 85c58cd3ad210a4be49842ec0f272b2aebc5938e
Author: August Sodora <augsod at gmail.com>
Date:   Fri Jan 20 00:45:36 2012 -0500

    Remove unused SV_DECL_PTRARR

diff --git a/sfx2/source/appl/appdata.cxx b/sfx2/source/appl/appdata.cxx
index 07a0c09..182ed41 100644
--- a/sfx2/source/appl/appdata.cxx
+++ b/sfx2/source/appl/appdata.cxx
@@ -95,7 +95,6 @@ SfxAppData_Impl::SfxAppData_Impl( SfxApplication* )
     , pDdeService2(0)
     , pFactArr(0)
     , pTopFrames( new SfxFrameArr_Impl )
-    , pInitLinkList(0)
     , pMatcher( 0 )
     , pBasicResMgr( 0 )
     , pSvtResMgr( 0 )
diff --git a/sfx2/source/appl/appquit.cxx b/sfx2/source/appl/appquit.cxx
index 094a44b..f5a8f59 100644
--- a/sfx2/source/appl/appquit.cxx
+++ b/sfx2/source/appl/appquit.cxx
@@ -140,7 +140,6 @@ void SfxApplication::Deinitialize()
 
     DELETEX(pAppData_Impl->pSlotPool);
     DELETEX(pAppData_Impl->pFactArr);
-    DELETEX(pAppData_Impl->pInitLinkList);
 
     DELETEX(pAppData_Impl->pTbxCtrlFac);
     DELETEX(pAppData_Impl->pStbCtrlFac);
diff --git a/sfx2/source/inc/appdata.hxx b/sfx2/source/inc/appdata.hxx
index 3259066..96a3118 100644
--- a/sfx2/source/inc/appdata.hxx
+++ b/sfx2/source/inc/appdata.hxx
@@ -47,7 +47,6 @@ class DdeService;
 class SfxEventConfiguration;
 class SfxMacroConfig;
 class SfxItemPool;
-class SfxInitLinkList;
 class SfxFilterMatcher;
 class ISfxTemplateCommon;
 class SfxFilterMatcher;
@@ -82,11 +81,6 @@ class SfxBasicManagerCreationListener;
 namespace sfx2 { namespace appl { class ImeStatusWindow; } }
 
 typedef Link* LinkPtr;
-SV_DECL_PTRARR(SfxInitLinkList, LinkPtr, 4, 4)
-
-//=========================================================================
-// SfxAppData_Impl
-//=========================================================================
 
 class SfxAppData_Impl
 {
@@ -104,9 +98,6 @@ public:
     SfxChildWinFactArr_Impl*            pFactArr;
     SfxFrameArr_Impl*                   pTopFrames;
 
-    // special members
-    SfxInitLinkList*                    pInitLinkList;
-
     // application members
     SfxFilterMatcher*                   pMatcher;
     ResMgr*                             pBasicResMgr;
commit 94d4764a42f8f38b884bb8960791d80ac876b786
Author: August Sodora <augsod at gmail.com>
Date:   Fri Jan 20 00:43:05 2012 -0500

    SV_DECL_PTRARR->std::vector

diff --git a/sfx2/source/inc/virtmenu.hxx b/sfx2/source/inc/virtmenu.hxx
index cc7cb26..998fe66 100644
--- a/sfx2/source/inc/virtmenu.hxx
+++ b/sfx2/source/inc/virtmenu.hxx
@@ -28,8 +28,6 @@
 #ifndef _SFXVIRTMENU_HXX
 #define _SFXVIRTMENU_HXX
 
-
-#include <svl/svarray.hxx>
 #include <sfx2/mnuitem.hxx>
 #include "mnucfga.hxx"
 
@@ -37,7 +35,7 @@ class SfxBindings;
 class Timer;
 class SfxMenuImageControl_Impl;
 
-SV_DECL_PTRARR_DEL( SfxMenuCtrlArr_Impl, SfxMenuControl*, 2, 2 )
+typedef std::vector<SfxMenuControl*> SfxMenuCtrlArr_Impl;
 
 class SAL_DLLPUBLIC_EXPORT SfxVirtualMenu
 {
diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx
index 28fd98c..c62dfd5 100644
--- a/sfx2/source/menu/virtmenu.cxx
+++ b/sfx2/source/menu/virtmenu.cxx
@@ -66,14 +66,9 @@ using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::frame;
 using namespace ::com::sun::star::uno;
 
-//=========================================================================
-
 DBG_NAME(SfxVirtualMenu)
 
-//=========================================================================
-
 typedef SfxMenuControl* SfxMenuControlPtr;
-SV_IMPL_PTRARR(SfxMenuCtrlArr_Impl, SfxMenuControlPtr);
 
 class SfxMenuImageControl_Impl : public SfxControllerItem
 {
@@ -401,7 +396,7 @@ void SfxVirtualMenu::CreateFromSVMenu()
                 pPopup = 0;
 
                 SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
-                rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count() );
+                rCtrlArr.push_back(pMnuCtrl);
                 (pItems+nPos)->Bind( 0, nSlotId, sItemText, *pBindings);
                 pMnuCtrl->Bind( this, nSlotId, sItemText, *pBindings);
 
@@ -444,7 +439,7 @@ void SfxVirtualMenu::CreateFromSVMenu()
                         if ( pMnuCtrl )
                         {
                             SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
-                            rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count());
+                            rCtrlArr.push_back(pMnuCtrl);
                             (pItems+nPos)->Bind( 0, nSlotId, sItemText, *pBindings);
                         }
                     }
@@ -456,7 +451,7 @@ void SfxVirtualMenu::CreateFromSVMenu()
                         if ( pMnuCtrl )
                         {
                             SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
-                            rCtrlArr.C40_INSERT( SfxMenuControl, pMnuCtrl, rCtrlArr.Count());
+                            rCtrlArr.push_back(pMnuCtrl);
                             (pItems+nPos)->Bind( 0, nSlotId, sItemText, *pBindings);
                         }
                         else
@@ -736,12 +731,11 @@ void SfxVirtualMenu::BindControllers()
     }
 
     SfxMenuCtrlArr_Impl& rCtrlArr = GetAppCtrl_Impl();
-    for ( nPos=0; nPos<rCtrlArr.Count(); nPos++ )
+    for(SfxMenuCtrlArr_Impl::const_iterator i = rCtrlArr.begin(); i != rCtrlArr.end(); ++i)
     {
-        SfxMenuControl* pCtrl = rCtrlArr[nPos];
-        sal_uInt16 nSlotId = pCtrl->GetId();
+        sal_uInt16 nSlotId = (*i)->GetId();
         if ( !pSVMenu->GetItemCommand(nSlotId).Len() )
-            pCtrl->ReBind();
+            (*i)->ReBind();
     }
 
     pBindings->LEAVEREGISTRATIONS();
@@ -761,12 +755,11 @@ void SfxVirtualMenu::UnbindControllers()
     }
 
     SfxMenuCtrlArr_Impl& rCtrlArr = GetAppCtrl_Impl();
-    for ( nPos=0; nPos<rCtrlArr.Count(); nPos++ )
+    for(SfxMenuCtrlArr_Impl::const_iterator i = rCtrlArr.begin(); i != rCtrlArr.end(); ++i)
     {
-        SfxMenuControl* pCtrl = rCtrlArr[nPos];
-        if ( pCtrl->IsBound() )
+        if((*i)->IsBound())
             // UnoController is not binded!
-            pCtrl->UnBind();
+            (*i)->UnBind();
     }
 
     pBindings->LEAVEREGISTRATIONS();
commit 00081bb2fdf263d784082fb202d7802418ac7666
Author: August Sodora <augsod at gmail.com>
Date:   Fri Jan 20 00:37:42 2012 -0500

    SV_DECL_PTRARR->std::vector

diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx
index edd5495..3d77c18 100644
--- a/sfx2/source/view/viewimp.hxx
+++ b/sfx2/source/view/viewimp.hxx
@@ -29,8 +29,6 @@
 #ifndef SFX_VIEWIMP_HXX
 #define SFX_VIEWIMP_HXX
 
-// include ---------------------------------------------------------------
-
 #include <basic/sbxobj.hxx>
 #include <sfx2/viewsh.hxx>
 #include <sfx2/viewfrm.hxx>                  // SvBorder
@@ -43,13 +41,11 @@
 #include <vcl/print.hxx>
 #include <queue>
 
-// forward ---------------------------------------------------------------
-
 class SfxOfficeDispatch;
 class SfxBaseController;
 
 typedef SfxShell* SfxShellPtr_Impl;
-SV_DECL_PTRARR( SfxShellArr_Impl, SfxShellPtr_Impl, 4, 4 )
+typedef std::vector<SfxShellPtr_Impl> SfxShellArr_Impl;
 
 class SfxClipboardChangeListener;
 
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 2c6bc12..c1bf067 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1480,7 +1480,7 @@ sal_Bool SfxViewShell::HasSelection( sal_Bool ) const
 
 void SfxViewShell::AddSubShell( SfxShell& rShell )
 {
-    pImp->aArr.Insert( &rShell, pImp->aArr.Count() );
+    pImp->aArr.push_back(&rShell);
     SfxDispatcher *pDisp = pFrame->GetDispatcher();
     if ( pDisp->IsActive(*this) )
     {
@@ -1494,25 +1494,24 @@ void SfxViewShell::RemoveSubShell( SfxShell* pShell )
     SfxDispatcher *pDisp = pFrame->GetDispatcher();
     if ( !pShell )
     {
-        sal_uInt16 nCount = pImp->aArr.Count();
+        size_t nCount = pImp->aArr.size();
         if ( pDisp->IsActive(*this) )
         {
-            for ( sal_uInt16 n=nCount; n>0; n-- )
-                pDisp->Pop( *pImp->aArr[n-1] );
+            for(size_t n = nCount; n > 0; --n)
+                pDisp->Pop(*pImp->aArr[n - 1]);
             pDisp->Flush();
         }
-
-        pImp->aArr.Remove(0, nCount);
+        pImp->aArr.clear();
     }
     else
     {
-        sal_uInt16 nPos = pImp->aArr.GetPos( pShell );
-        if ( nPos != 0xFFFF )
+        SfxShellArr_Impl::iterator i = std::find(pImp->aArr.begin(), pImp->aArr.end(), pShell);
+        if(i != pImp->aArr.end())
         {
-            pImp->aArr.Remove( nPos );
-            if ( pDisp->IsActive(*this) )
+            pImp->aArr.erase(i);
+            if(pDisp->IsActive(*this))
             {
-                pDisp->RemoveShell_Impl( *pShell );
+                pDisp->RemoveShell_Impl(*pShell);
                 pDisp->Flush();
             }
         }
@@ -1521,22 +1520,21 @@ void SfxViewShell::RemoveSubShell( SfxShell* pShell )
 
 SfxShell* SfxViewShell::GetSubShell( sal_uInt16 nNo )
 {
-    sal_uInt16 nCount = pImp->aArr.Count();
-    if ( nNo<nCount )
-        return pImp->aArr[nCount-nNo-1];
+    sal_uInt16 nCount = pImp->aArr.size();
+    if(nNo < nCount)
+        return pImp->aArr[nCount - nNo - 1];
     return NULL;
 }
 
 void SfxViewShell::PushSubShells_Impl( sal_Bool bPush )
 {
-    sal_uInt16 nCount = pImp->aArr.Count();
     SfxDispatcher *pDisp = pFrame->GetDispatcher();
     if ( bPush )
     {
-        for ( sal_uInt16 n=0; n<nCount; n++ )
-            pDisp->Push( *pImp->aArr[n] );
+        for(SfxShellArr_Impl::const_iterator i = pImp->aArr.begin(); i != pImp->aArr.end(); ++i)
+            pDisp->Push(**i);
     }
-    else if ( nCount )
+    else if(!pImp->aArr.empty())
     {
         SfxShell& rPopUntil = *pImp->aArr[0];
         if ( pDisp->GetShellLevel( rPopUntil ) != USHRT_MAX )


More information about the Libreoffice-commits mailing list