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 | |
parent | 51f9d14ae75bb01ebb79a5ed85eecabc794da490 (diff) |
sfx2: boost::ptr_vector->std::vector
Change-Id: Icb9c44a6c251817a66276af32f0c2d1b26fb923a
-rw-r--r-- | include/sfx2/app.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/mnuitem.hxx | 4 | ||||
-rw-r--r-- | include/sfx2/module.hxx | 2 | ||||
-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 |
8 files changed, 20 insertions, 19 deletions
diff --git a/include/sfx2/app.hxx b/include/sfx2/app.hxx index 8db9229f3fe1..f9d4cd8fc6f7 100644 --- a/include/sfx2/app.hxx +++ b/include/sfx2/app.hxx @@ -199,7 +199,7 @@ public: SAL_DLLPRIVATE void RegisterChildWindow_Impl(SfxModule*, SfxChildWinFactory*); SAL_DLLPRIVATE void RegisterChildWindowContext_Impl(SfxModule*, sal_uInt16, SfxChildWinContextFactory*); SAL_DLLPRIVATE void RegisterStatusBarControl_Impl(SfxModule*, SfxStbCtrlFactory*); - SAL_DLLPRIVATE void RegisterMenuControl_Impl(SfxModule*, SfxMenuCtrlFactory*); + SAL_DLLPRIVATE void RegisterMenuControl_Impl(SfxModule*, const SfxMenuCtrlFactory&); SAL_DLLPRIVATE void RegisterToolBoxControl_Impl( SfxModule*, SfxTbxCtrlFactory*); SAL_DLLPRIVATE SfxTbxCtrlFactArr_Impl& GetTbxCtrlFactories_Impl() const; SAL_DLLPRIVATE SfxStbCtrlFactArr_Impl& GetStbCtrlFactories_Impl() const; diff --git a/include/sfx2/mnuitem.hxx b/include/sfx2/mnuitem.hxx index 7afaec06c3a8..56dc4bd63852 100644 --- a/include/sfx2/mnuitem.hxx +++ b/include/sfx2/mnuitem.hxx @@ -68,7 +68,7 @@ public: static SfxMenuControl* CreateControl( sal_uInt16 nId, Menu &, SfxBindings & ); static SfxUnoMenuControl* CreateControl( const OUString&, sal_uInt16, Menu&, const OUString& sItemText, SfxBindings&, SfxVirtualMenu* ); - static void RegisterMenuControl( SfxModule*, SfxMenuCtrlFactory* ); + static void RegisterMenuControl( SfxModule*, const SfxMenuCtrlFactory& ); }; @@ -116,7 +116,7 @@ inline SfxVirtualMenu* SfxMenuControl::GetPopupMenu() const SfxMenuControl* Class::CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings ) \ { return new Class(nId, rMenu, rBindings); } \ void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \ - { SfxMenuControl::RegisterMenuControl( pMod, new SfxMenuCtrlFactory( \ + { SfxMenuControl::RegisterMenuControl( pMod, SfxMenuCtrlFactory( \ Class::CreateImpl, typeid(nItemClass), nSlotId ) ); } #endif diff --git a/include/sfx2/module.hxx b/include/sfx2/module.hxx index 6d257b19a276..363bbf92d748 100644 --- a/include/sfx2/module.hxx +++ b/include/sfx2/module.hxx @@ -80,7 +80,7 @@ public: void RegisterToolBoxControl(SfxTbxCtrlFactory*); void RegisterChildWindow(SfxChildWinFactory*); void RegisterStatusBarControl(SfxStbCtrlFactory*); - void RegisterMenuControl(SfxMenuCtrlFactory*); + void RegisterMenuControl(const SfxMenuCtrlFactory&); virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, vcl::Window* pParent, 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 ) |