Kaydet (Commit) b6639b0e authored tarafından Noel Grandin's avatar Noel Grandin

sfx2: boost::ptr_vector->std::vector

Change-Id: Icb9c44a6c251817a66276af32f0c2d1b26fb923a
üst 51f9d14a
...@@ -199,7 +199,7 @@ public: ...@@ -199,7 +199,7 @@ public:
SAL_DLLPRIVATE void RegisterChildWindow_Impl(SfxModule*, SfxChildWinFactory*); SAL_DLLPRIVATE void RegisterChildWindow_Impl(SfxModule*, SfxChildWinFactory*);
SAL_DLLPRIVATE void RegisterChildWindowContext_Impl(SfxModule*, sal_uInt16, SfxChildWinContextFactory*); SAL_DLLPRIVATE void RegisterChildWindowContext_Impl(SfxModule*, sal_uInt16, SfxChildWinContextFactory*);
SAL_DLLPRIVATE void RegisterStatusBarControl_Impl(SfxModule*, SfxStbCtrlFactory*); 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 void RegisterToolBoxControl_Impl( SfxModule*, SfxTbxCtrlFactory*);
SAL_DLLPRIVATE SfxTbxCtrlFactArr_Impl& GetTbxCtrlFactories_Impl() const; SAL_DLLPRIVATE SfxTbxCtrlFactArr_Impl& GetTbxCtrlFactories_Impl() const;
SAL_DLLPRIVATE SfxStbCtrlFactArr_Impl& GetStbCtrlFactories_Impl() const; SAL_DLLPRIVATE SfxStbCtrlFactArr_Impl& GetStbCtrlFactories_Impl() const;
......
...@@ -68,7 +68,7 @@ public: ...@@ -68,7 +68,7 @@ public:
static SfxMenuControl* CreateControl( sal_uInt16 nId, Menu &, SfxBindings & ); static SfxMenuControl* CreateControl( sal_uInt16 nId, Menu &, SfxBindings & );
static SfxUnoMenuControl* CreateControl( const OUString&, sal_uInt16, Menu&, const OUString& sItemText, SfxBindings&, SfxVirtualMenu* ); 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 ...@@ -116,7 +116,7 @@ inline SfxVirtualMenu* SfxMenuControl::GetPopupMenu() const
SfxMenuControl* Class::CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings ) \ SfxMenuControl* Class::CreateImpl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings ) \
{ return new Class(nId, rMenu, rBindings); } \ { return new Class(nId, rMenu, rBindings); } \
void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \ void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
{ SfxMenuControl::RegisterMenuControl( pMod, new SfxMenuCtrlFactory( \ { SfxMenuControl::RegisterMenuControl( pMod, SfxMenuCtrlFactory( \
Class::CreateImpl, typeid(nItemClass), nSlotId ) ); } Class::CreateImpl, typeid(nItemClass), nSlotId ) ); }
#endif #endif
......
...@@ -80,7 +80,7 @@ public: ...@@ -80,7 +80,7 @@ public:
void RegisterToolBoxControl(SfxTbxCtrlFactory*); void RegisterToolBoxControl(SfxTbxCtrlFactory*);
void RegisterChildWindow(SfxChildWinFactory*); void RegisterChildWindow(SfxChildWinFactory*);
void RegisterStatusBarControl(SfxStbCtrlFactory*); void RegisterStatusBarControl(SfxStbCtrlFactory*);
void RegisterMenuControl(SfxMenuCtrlFactory*); void RegisterMenuControl(const SfxMenuCtrlFactory&);
virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId,
vcl::Window* pParent, vcl::Window* pParent,
......
...@@ -116,11 +116,11 @@ void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlF ...@@ -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 ) if ( pMod )
{ {
pMod->RegisterMenuControl( pFact ); pMod->RegisterMenuControl( rFact );
return; return;
} }
...@@ -128,15 +128,15 @@ void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFacto ...@@ -128,15 +128,15 @@ void SfxApplication::RegisterMenuControl_Impl( SfxModule *pMod, SfxMenuCtrlFacto
for ( size_t n=0; n<pAppData_Impl->pMenuCtrlFac->size(); n++ ) for ( size_t n=0; n<pAppData_Impl->pMenuCtrlFac->size(); n++ )
{ {
SfxMenuCtrlFactory *pF = &(*pAppData_Impl->pMenuCtrlFac)[n]; SfxMenuCtrlFactory *pF = &(*pAppData_Impl->pMenuCtrlFac)[n];
if ( pF->nTypeId == pFact->nTypeId && if ( pF->nTypeId == rFact.nTypeId &&
(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) ) (pF->nSlotId == rFact.nSlotId || pF->nSlotId == 0) )
{ {
SAL_INFO("sfx", "MenuController register is not clearly defined!"); SAL_INFO("sfx", "MenuController register is not clearly defined!");
} }
} }
#endif #endif
pAppData_Impl->pMenuCtrlFac->push_back( pFact ); pAppData_Impl->pMenuCtrlFac->push_back( rFact );
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -277,7 +277,7 @@ void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact ) ...@@ -277,7 +277,7 @@ void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact )
void SfxModule::RegisterMenuControl( SfxMenuCtrlFactory *pFact ) void SfxModule::RegisterMenuControl( const SfxMenuCtrlFactory& rFact )
{ {
if (!pImpl->pMenuCtrlFac) if (!pImpl->pMenuCtrlFac)
pImpl->pMenuCtrlFac = new SfxMenuCtrlFactArr_Impl; pImpl->pMenuCtrlFac = new SfxMenuCtrlFactArr_Impl;
...@@ -286,15 +286,15 @@ void SfxModule::RegisterMenuControl( SfxMenuCtrlFactory *pFact ) ...@@ -286,15 +286,15 @@ void SfxModule::RegisterMenuControl( SfxMenuCtrlFactory *pFact )
for ( size_t n=0; n<pImpl->pMenuCtrlFac->size(); n++ ) for ( size_t n=0; n<pImpl->pMenuCtrlFac->size(); n++ )
{ {
SfxMenuCtrlFactory *pF = &(*pImpl->pMenuCtrlFac)[n]; SfxMenuCtrlFactory *pF = &(*pImpl->pMenuCtrlFac)[n];
if ( pF->nTypeId == pFact->nTypeId && if ( pF->nTypeId == rFact.nTypeId &&
(pF->nSlotId == pFact->nSlotId || pF->nSlotId == 0) ) (pF->nSlotId == rFact.nSlotId || pF->nSlotId == 0) )
{ {
SAL_INFO("sfx2.appl", "MenuController-Registering is not clearly defined!"); SAL_INFO("sfx2.appl", "MenuController-Registering is not clearly defined!");
} }
} }
#endif #endif
pImpl->pMenuCtrlFac->push_back( pFact ); pImpl->pMenuCtrlFac->push_back( rFact );
} }
......
...@@ -29,7 +29,7 @@ SfxMenuCtrlFactory& SfxMenuCtrlFactArr_Impl::operator []( size_t i ) ...@@ -29,7 +29,7 @@ SfxMenuCtrlFactory& SfxMenuCtrlFactArr_Impl::operator []( size_t i )
return maData[i]; return maData[i];
} }
void SfxMenuCtrlFactArr_Impl::push_back( SfxMenuCtrlFactory* p ) void SfxMenuCtrlFactArr_Impl::push_back( const SfxMenuCtrlFactory& p )
{ {
maData.push_back(p); maData.push_back(p);
} }
......
...@@ -25,17 +25,18 @@ ...@@ -25,17 +25,18 @@
#include <sfx2/tbxctrl.hxx> #include <sfx2/tbxctrl.hxx>
#include <boost/ptr_container/ptr_vector.hpp> #include <boost/ptr_container/ptr_vector.hpp>
#include <vector>
class SfxMenuCtrlFactArr_Impl class SfxMenuCtrlFactArr_Impl
{ {
typedef boost::ptr_vector<SfxMenuCtrlFactory> DataType; typedef std::vector<SfxMenuCtrlFactory> DataType;
DataType maData; DataType maData;
public: public:
const SfxMenuCtrlFactory& operator []( size_t i ) const; const SfxMenuCtrlFactory& operator []( size_t i ) const;
SfxMenuCtrlFactory& operator []( size_t i ); SfxMenuCtrlFactory& operator []( size_t i );
void push_back( SfxMenuCtrlFactory* p ); void push_back( const SfxMenuCtrlFactory& );
size_t size() const; size_t size() const;
}; };
......
...@@ -246,14 +246,14 @@ SfxMenuControl* SfxMenuControl::CreateImpl( sal_uInt16 /*nId*/, Menu& /*rMenu*/, ...@@ -246,14 +246,14 @@ SfxMenuControl* SfxMenuControl::CreateImpl( sal_uInt16 /*nId*/, Menu& /*rMenu*/,
void SfxMenuControl::RegisterControl( sal_uInt16 nSlotId, SfxModule *pMod ) void SfxMenuControl::RegisterControl( sal_uInt16 nSlotId, SfxModule *pMod )
{ {
RegisterMenuControl( pMod, new SfxMenuCtrlFactory( RegisterMenuControl( pMod, SfxMenuCtrlFactory(
SfxMenuControl::CreateImpl, typeid(SfxStringItem), nSlotId ) ); 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 ) SfxMenuControl* SfxMenuControl::CreateControl( sal_uInt16 nId, Menu &rMenu, SfxBindings &rBindings )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment