diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-11 12:51:09 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-12 08:01:34 +0200 |
commit | b6639b0e12e2bf914371124b870e55761b1155a2 (patch) | |
tree | ef1feae7910472bbb8deb5b135c20de421d4943c /sfx2 | |
parent | 51f9d14ae75bb01ebb79a5ed85eecabc794da490 (diff) |
sfx2: boost::ptr_vector->std::vector
Change-Id: Icb9c44a6c251817a66276af32f0c2d1b26fb923a
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appreg.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/appl/module.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/control/ctrlfactoryimpl.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/inc/ctrlfactoryimpl.hxx | 5 | ||||
-rw-r--r-- | sfx2/source/menu/mnuitem.cxx | 6 |
5 files changed, 16 insertions, 15 deletions
diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx index 215478f566f2..04b68b8baf0e 100644 --- a/sfx2/source/appl/appreg.cxx +++ b/sfx2/source/appl/appreg.cxx @@ -116,11 +116,11 @@ void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlF -void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFactory *pFact ) +void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, const SfxMenuCtrlFactory& rFact ) { if ( pMod ) { - pMod->RegisterMenuControl( pFact ); + pMod->RegisterMenuControl( rFact ); return; } @@ -128,15 +128,15 @@ void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFacto for ( size_t n=0; n<pAppData_Impl->pMenuCtrlFac->size(); n++ ) { SfxMenuCtrlFactory *pF = &(*pAppData_Impl->pMenuCtrlFac)[n]; - if ( pF->nTypeId == pFact->nTypeId && - (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) ) + if ( pF->nTypeId == rFact.nTypeId && + (pF->nSlotId == rFact.nSlotId || pF->nSlotId == 0) ) { SAL_INFO("sfx", "MenuController register is not clearly defined!"); } } #endif - pAppData_Impl->pMenuCtrlFac->push_back( pFact ); + pAppData_Impl->pMenuCtrlFac->push_back( rFact ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index 6de9ecb4caa9..f9152c9a012f 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -277,7 +277,7 @@ void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact ) -void SfxModule::RegisterMenuControl( SfxMenuCtrlFactory *pFact ) +void SfxModule::RegisterMenuControl( const SfxMenuCtrlFactory& rFact ) { if (!pImpl->pMenuCtrlFac) pImpl->pMenuCtrlFac = new SfxMenuCtrlFactArr_Impl; @@ -286,15 +286,15 @@ void SfxModule::RegisterMenuControl( SfxMenuCtrlFactory *pFact ) for ( size_t n=0; n<pImpl->pMenuCtrlFac->size(); n++ ) { SfxMenuCtrlFactory *pF = &(*pImpl->pMenuCtrlFac)[n]; - if ( pF->nTypeId == pFact->nTypeId && - (pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) ) + if ( pF->nTypeId == rFact.nTypeId && + (pF->nSlotId == rFact.nSlotId || pF->nSlotId == 0) ) { SAL_INFO("sfx2.appl", "MenuController-Registering is not clearly defined!"); } } #endif - pImpl->pMenuCtrlFac->push_back( pFact ); + pImpl->pMenuCtrlFac->push_back( rFact ); } diff --git a/sfx2/source/control/ctrlfactoryimpl.cxx b/sfx2/source/control/ctrlfactoryimpl.cxx index 9a877e143ece..6bfe2d44bdd7 100644 --- a/sfx2/source/control/ctrlfactoryimpl.cxx +++ b/sfx2/source/control/ctrlfactoryimpl.cxx @@ -29,7 +29,7 @@ SfxMenuCtrlFactory& SfxMenuCtrlFactArr_Impl::operator []( size_t i ) return maData[i]; } -void SfxMenuCtrlFactArr_Impl::push_back( SfxMenuCtrlFactory* p ) +void SfxMenuCtrlFactArr_Impl::push_back( const SfxMenuCtrlFactory& p ) { maData.push_back(p); } diff --git a/sfx2/source/inc/ctrlfactoryimpl.hxx b/sfx2/source/inc/ctrlfactoryimpl.hxx index 81feb31a8ef6..28e92d87a094 100644 --- a/sfx2/source/inc/ctrlfactoryimpl.hxx +++ b/sfx2/source/inc/ctrlfactoryimpl.hxx @@ -25,17 +25,18 @@ #include <sfx2/tbxctrl.hxx> #include <boost/ptr_container/ptr_vector.hpp> +#include <vector> class SfxMenuCtrlFactArr_Impl { - typedef boost::ptr_vector<SfxMenuCtrlFactory> DataType; + typedef std::vector<SfxMenuCtrlFactory> DataType; DataType maData; public: const SfxMenuCtrlFactory& operator []( size_t i ) const; SfxMenuCtrlFactory& operator []( size_t i ); - void push_back( SfxMenuCtrlFactory* p ); + void push_back( const SfxMenuCtrlFactory& ); size_t size() const; }; diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx index cf76a3a20ca7..b871d7120069 100644 --- a/sfx2/source/menu/mnuitem.cxx +++ b/sfx2/source/menu/mnuitem.cxx @@ -246,14 +246,14 @@ SfxMenuControl* SfxMenuControl::CreateImpl( sal_uInt16 /*nId*/, Menu& /*rMenu*/, void SfxMenuControl::RegisterControl( sal_uInt16 nSlotId, SfxModule *pMod ) { - RegisterMenuControl( pMod, new SfxMenuCtrlFactory( + RegisterMenuControl( pMod, SfxMenuCtrlFactory( SfxMenuControl::CreateImpl, typeid(SfxStringItem), nSlotId ) ); } -void SfxMenuControl::RegisterMenuControl(SfxModule* pMod, SfxMenuCtrlFactory* pFact) +void SfxMenuControl::RegisterMenuControl(SfxModule* pMod, const SfxMenuCtrlFactory& rFact) { - SfxGetpApp()->RegisterMenuControl_Impl( pMod, pFact ); + SfxGetpApp()->RegisterMenuControl_Impl( pMod, rFact ); } SfxMenuControl* SfxMenuControl::CreateControl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings ) |