diff options
author | Noel Grandin <noel@peralex.com> | 2015-11-11 13:52:28 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-11-12 08:01:35 +0200 |
commit | 31a4248332cc95a23337ac9c6d7218fe109bce57 (patch) | |
tree | 5f522554dc047e8f9fa1d5c545d10ecbf3e22558 /sfx2 | |
parent | b6639b0e12e2bf914371124b870e55761b1155a2 (diff) |
sfx2: boost::ptr_vector->std::vector
Change-Id: I0ffe29145fb56f284300d40dfea323a8b16c26de
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/appreg.cxx | 20 | ||||
-rw-r--r-- | sfx2/source/appl/module.cxx | 16 | ||||
-rw-r--r-- | sfx2/source/control/ctrlfactoryimpl.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/inc/ctrlfactoryimpl.hxx | 9 | ||||
-rw-r--r-- | sfx2/source/statbar/stbitem.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/toolbox/tbxitem.cxx | 4 |
6 files changed, 28 insertions, 29 deletions
diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx index 04b68b8baf0e..fc648ff36c8f 100644 --- a/sfx2/source/appl/appreg.cxx +++ b/sfx2/source/appl/appreg.cxx @@ -66,11 +66,11 @@ void SfxApplication::Registrations_Impl() -void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFactory *pFact ) +void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, const SfxTbxCtrlFactory& rFact ) { if ( pMod ) { - pMod->RegisterToolBoxControl( pFact ); + pMod->RegisterToolBoxControl( rFact ); return; } @@ -78,24 +78,24 @@ void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFac for ( size_t n=0; n<pAppData_Impl->pTbxCtrlFac->size(); n++ ) { SfxTbxCtrlFactory *pF = &(*pAppData_Impl->pTbxCtrlFac)[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", "TbxController registration is not clearly defined!"); } } #endif - pAppData_Impl->pTbxCtrlFac->push_back( pFact ); + pAppData_Impl->pTbxCtrlFac->push_back( rFact ); } -void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlFactory *pFact ) +void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, const SfxStbCtrlFactory& rFact ) { if ( pMod ) { - pMod->RegisterStatusBarControl( pFact ); + pMod->RegisterStatusBarControl( rFact ); return; } @@ -103,15 +103,15 @@ void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlF for ( size_t n=0; n<pAppData_Impl->pStbCtrlFac->size(); n++ ) { SfxStbCtrlFactory *pF = &(*pAppData_Impl->pStbCtrlFac)[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", "StbController registration is not clearly defined!"); } } #endif - pAppData_Impl->pStbCtrlFac->push_back( pFact ); + pAppData_Impl->pStbCtrlFac->push_back( rFact ); } diff --git a/sfx2/source/appl/module.cxx b/sfx2/source/appl/module.cxx index f9152c9a012f..327ace286269 100644 --- a/sfx2/source/appl/module.cxx +++ b/sfx2/source/appl/module.cxx @@ -233,7 +233,7 @@ void SfxModule::RegisterChildWindow(SfxChildWinFactory *pFact) -void SfxModule::RegisterToolBoxControl( SfxTbxCtrlFactory *pFact ) +void SfxModule::RegisterToolBoxControl( const SfxTbxCtrlFactory& rFact ) { if (!pImpl->pTbxCtrlFac) pImpl->pTbxCtrlFac = new SfxTbxCtrlFactArr_Impl; @@ -242,20 +242,20 @@ void SfxModule::RegisterToolBoxControl( SfxTbxCtrlFactory *pFact ) for ( size_t n=0; n<pImpl->pTbxCtrlFac->size(); n++ ) { SfxTbxCtrlFactory *pF = &(*pImpl->pTbxCtrlFac)[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", "TbxController-Registering is not clearly defined!"); } } #endif - pImpl->pTbxCtrlFac->push_back( pFact ); + pImpl->pTbxCtrlFac->push_back( rFact ); } -void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact ) +void SfxModule::RegisterStatusBarControl( const SfxStbCtrlFactory& rFact ) { if (!pImpl->pStbCtrlFac) pImpl->pStbCtrlFac = new SfxStbCtrlFactArr_Impl; @@ -264,15 +264,15 @@ void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact ) for ( size_t n=0; n<pImpl->pStbCtrlFac->size(); n++ ) { SfxStbCtrlFactory *pF = &(*pImpl->pStbCtrlFac)[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", "TbxController-Registering is not clearly defined!"); } } #endif - pImpl->pStbCtrlFac->push_back( pFact ); + pImpl->pStbCtrlFac->push_back( rFact ); } diff --git a/sfx2/source/control/ctrlfactoryimpl.cxx b/sfx2/source/control/ctrlfactoryimpl.cxx index 6bfe2d44bdd7..1df7301b495d 100644 --- a/sfx2/source/control/ctrlfactoryimpl.cxx +++ b/sfx2/source/control/ctrlfactoryimpl.cxx @@ -49,7 +49,7 @@ SfxStbCtrlFactory& SfxStbCtrlFactArr_Impl::operator []( size_t i ) return maData[i]; } -void SfxStbCtrlFactArr_Impl::push_back( SfxStbCtrlFactory* p ) +void SfxStbCtrlFactArr_Impl::push_back( const SfxStbCtrlFactory& p ) { maData.push_back(p); } @@ -69,7 +69,7 @@ SfxTbxCtrlFactory& SfxTbxCtrlFactArr_Impl::operator []( size_t i ) return maData[i]; } -void SfxTbxCtrlFactArr_Impl::push_back( SfxTbxCtrlFactory* p ) +void SfxTbxCtrlFactArr_Impl::push_back( const SfxTbxCtrlFactory& p ) { maData.push_back(p); } diff --git a/sfx2/source/inc/ctrlfactoryimpl.hxx b/sfx2/source/inc/ctrlfactoryimpl.hxx index 28e92d87a094..38a25d8fa099 100644 --- a/sfx2/source/inc/ctrlfactoryimpl.hxx +++ b/sfx2/source/inc/ctrlfactoryimpl.hxx @@ -24,7 +24,6 @@ #include <sfx2/stbitem.hxx> #include <sfx2/tbxctrl.hxx> -#include <boost/ptr_container/ptr_vector.hpp> #include <vector> class SfxMenuCtrlFactArr_Impl @@ -43,28 +42,28 @@ public: class SfxStbCtrlFactArr_Impl { - typedef boost::ptr_vector<SfxStbCtrlFactory> DataType; + typedef std::vector<SfxStbCtrlFactory> DataType; DataType maData; public: const SfxStbCtrlFactory& operator []( size_t i ) const; SfxStbCtrlFactory& operator []( size_t i ); - void push_back( SfxStbCtrlFactory* p ); + void push_back( const SfxStbCtrlFactory& ); size_t size() const; }; class SfxTbxCtrlFactArr_Impl { - typedef boost::ptr_vector<SfxTbxCtrlFactory> DataType; + typedef std::vector<SfxTbxCtrlFactory> DataType; DataType maData; public: const SfxTbxCtrlFactory& operator []( size_t i ) const; SfxTbxCtrlFactory& operator []( size_t i ); - void push_back( SfxTbxCtrlFactory* p ); + void push_back( const SfxTbxCtrlFactory& ); size_t size() const; }; diff --git a/sfx2/source/statbar/stbitem.cxx b/sfx2/source/statbar/stbitem.cxx index 4c0d962a3383..4b3b9c042f4f 100644 --- a/sfx2/source/statbar/stbitem.cxx +++ b/sfx2/source/statbar/stbitem.cxx @@ -633,9 +633,9 @@ SfxStatusBarControl* SfxStatusBarControl::CreateControl } -void SfxStatusBarControl::RegisterStatusBarControl(SfxModule* pMod, SfxStbCtrlFactory* pFact) +void SfxStatusBarControl::RegisterStatusBarControl(SfxModule* pMod, const SfxStbCtrlFactory& rFact) { - SfxGetpApp()->RegisterStatusBarControl_Impl( pMod, pFact ); + SfxGetpApp()->RegisterStatusBarControl_Impl( pMod, rFact ); } diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 7cbe75dde6a6..a23c55f02dc2 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -272,9 +272,9 @@ void SAL_CALL SfxToolBoxControl::dispose() throw (css::uno::RuntimeException, st } -void SfxToolBoxControl::RegisterToolBoxControl( SfxModule* pMod, SfxTbxCtrlFactory* pFact) +void SfxToolBoxControl::RegisterToolBoxControl( SfxModule* pMod, const SfxTbxCtrlFactory& rFact) { - SfxGetpApp()->RegisterToolBoxControl_Impl( pMod, pFact ); + SfxGetpApp()->RegisterToolBoxControl_Impl( pMod, rFact ); } SfxToolBoxControl* SfxToolBoxControl::CreateControl( sal_uInt16 nSlotId, sal_uInt16 nTbxId, ToolBox *pBox, SfxModule* pMod ) |