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

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

Change-Id: I0ffe29145fb56f284300d40dfea323a8b16c26de
üst b6639b0e
...@@ -198,9 +198,9 @@ public: ...@@ -198,9 +198,9 @@ public:
// Object-Factories/global arrays // Object-Factories/global arrays
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*, const SfxStbCtrlFactory&);
SAL_DLLPRIVATE void RegisterMenuControl_Impl(SfxModule*, const SfxMenuCtrlFactory&); SAL_DLLPRIVATE void RegisterMenuControl_Impl(SfxModule*, const SfxMenuCtrlFactory&);
SAL_DLLPRIVATE void RegisterToolBoxControl_Impl( SfxModule*, SfxTbxCtrlFactory*); SAL_DLLPRIVATE void RegisterToolBoxControl_Impl( SfxModule*, const 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;
SAL_DLLPRIVATE SfxMenuCtrlFactArr_Impl& GetMenuCtrlFactories_Impl() const; SAL_DLLPRIVATE SfxMenuCtrlFactArr_Impl& GetMenuCtrlFactories_Impl() const;
......
...@@ -77,9 +77,9 @@ public: ...@@ -77,9 +77,9 @@ public:
ResMgr* GetResMgr(); ResMgr* GetResMgr();
SfxSlotPool* GetSlotPool() const; SfxSlotPool* GetSlotPool() const;
void RegisterToolBoxControl(SfxTbxCtrlFactory*); void RegisterToolBoxControl(const SfxTbxCtrlFactory&);
void RegisterChildWindow(SfxChildWinFactory*); void RegisterChildWindow(SfxChildWinFactory*);
void RegisterStatusBarControl(SfxStbCtrlFactory*); void RegisterStatusBarControl(const SfxStbCtrlFactory&);
void RegisterMenuControl(const SfxMenuCtrlFactory&); void RegisterMenuControl(const SfxMenuCtrlFactory&);
virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId, virtual VclPtr<SfxTabPage> CreateTabPage( sal_uInt16 nId,
......
...@@ -115,7 +115,7 @@ public: ...@@ -115,7 +115,7 @@ public:
StatusBar& GetStatusBar() const { return *pBar; } StatusBar& GetStatusBar() const { return *pBar; }
static SfxStatusBarControl* CreateControl( sal_uInt16 nSlotID, sal_uInt16 nId, StatusBar *pBar, SfxModule* ); static SfxStatusBarControl* CreateControl( sal_uInt16 nSlotID, sal_uInt16 nId, StatusBar *pBar, SfxModule* );
static void RegisterStatusBarControl(SfxModule*, SfxStbCtrlFactory*); static void RegisterStatusBarControl(SfxModule*, const SfxStbCtrlFactory&);
}; };
...@@ -129,7 +129,7 @@ public: ...@@ -129,7 +129,7 @@ public:
SfxStatusBarControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb ) \ SfxStatusBarControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, StatusBar &rStb ) \
{ return new Class( nSlotId, nId, rStb ); } \ { return new Class( nSlotId, nId, rStb ); } \
void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \ void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
{ SfxStatusBarControl::RegisterStatusBarControl( pMod, new SfxStbCtrlFactory( \ { SfxStatusBarControl::RegisterStatusBarControl( pMod, SfxStbCtrlFactory( \
Class::CreateImpl, typeid(nItemClass), nSlotId ) ); } Class::CreateImpl, typeid(nItemClass), nSlotId ) ); }
......
...@@ -224,21 +224,21 @@ public: ...@@ -224,21 +224,21 @@ public:
static SfxItemState GetItemState( const SfxPoolItem* pState ); static SfxItemState GetItemState( const SfxPoolItem* pState );
static SfxToolBoxControl* CreateControl( sal_uInt16 nSlotId, sal_uInt16 nTbxId, ToolBox *pBox, SfxModule *pMod ); static SfxToolBoxControl* CreateControl( sal_uInt16 nSlotId, sal_uInt16 nTbxId, ToolBox *pBox, SfxModule *pMod );
static void RegisterToolBoxControl( SfxModule*, SfxTbxCtrlFactory*); static void RegisterToolBoxControl( SfxModule*, const SfxTbxCtrlFactory&);
}; };
#define SFX_IMPL_TOOLBOX_CONTROL(Class, nItemClass) \ #define SFX_IMPL_TOOLBOX_CONTROL(Class, nItemClass) \
SfxToolBoxControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \ SfxToolBoxControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \
{ return new Class( nSlotId, nId, rTbx ); } \ { return new Class( nSlotId, nId, rTbx ); } \
void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \ void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
{ SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( \ { SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( \
Class::CreateImpl, typeid(nItemClass), nSlotId ) ); } Class::CreateImpl, typeid(nItemClass), nSlotId ) ); }
#define SFX_IMPL_TOOLBOX_CONTROL_ARG(Class, nItemClass, Arg) \ #define SFX_IMPL_TOOLBOX_CONTROL_ARG(Class, nItemClass, Arg) \
SfxToolBoxControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \ SfxToolBoxControl* Class::CreateImpl( sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox &rTbx ) \
{ return new Class( nSlotId, nId, rTbx, Arg); } \ { return new Class( nSlotId, nId, rTbx, Arg); } \
void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \ void Class::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) \
{ SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( \ { SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( \
Class::CreateImpl, typeid(nItemClass), nSlotId ) ); } Class::CreateImpl, typeid(nItemClass), nSlotId ) ); }
......
...@@ -66,11 +66,11 @@ void SfxApplication::Registrations_Impl() ...@@ -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 ) if ( pMod )
{ {
pMod->RegisterToolBoxControl( pFact ); pMod->RegisterToolBoxControl( rFact );
return; return;
} }
...@@ -78,24 +78,24 @@ void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFac ...@@ -78,24 +78,24 @@ void SfxApplication::RegisterToolBoxControl_Impl( SfxModule *pMod, SfxTbxCtrlFac
for ( size_t n=0; n<pAppData_Impl->pTbxCtrlFac->size(); n++ ) for ( size_t n=0; n<pAppData_Impl->pTbxCtrlFac->size(); n++ )
{ {
SfxTbxCtrlFactory *pF = &(*pAppData_Impl->pTbxCtrlFac)[n]; SfxTbxCtrlFactory *pF = &(*pAppData_Impl->pTbxCtrlFac)[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", "TbxController registration is not clearly defined!"); SAL_INFO("sfx", "TbxController registration is not clearly defined!");
} }
} }
#endif #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 ) if ( pMod )
{ {
pMod->RegisterStatusBarControl( pFact ); pMod->RegisterStatusBarControl( rFact );
return; return;
} }
...@@ -103,15 +103,15 @@ void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlF ...@@ -103,15 +103,15 @@ void SfxApplication::RegisterStatusBarControl_Impl( SfxModule *pMod, SfxStbCtrlF
for ( size_t n=0; n<pAppData_Impl->pStbCtrlFac->size(); n++ ) for ( size_t n=0; n<pAppData_Impl->pStbCtrlFac->size(); n++ )
{ {
SfxStbCtrlFactory *pF = &(*pAppData_Impl->pStbCtrlFac)[n]; SfxStbCtrlFactory *pF = &(*pAppData_Impl->pStbCtrlFac)[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", "StbController registration is not clearly defined!"); SAL_INFO("sfx", "StbController registration is not clearly defined!");
} }
} }
#endif #endif
pAppData_Impl->pStbCtrlFac->push_back( pFact ); pAppData_Impl->pStbCtrlFac->push_back( rFact );
} }
......
...@@ -233,7 +233,7 @@ void SfxModule::RegisterChildWindow(SfxChildWinFactory *pFact) ...@@ -233,7 +233,7 @@ void SfxModule::RegisterChildWindow(SfxChildWinFactory *pFact)
void SfxModule::RegisterToolBoxControl( SfxTbxCtrlFactory *pFact ) void SfxModule::RegisterToolBoxControl( const SfxTbxCtrlFactory& rFact )
{ {
if (!pImpl->pTbxCtrlFac) if (!pImpl->pTbxCtrlFac)
pImpl->pTbxCtrlFac = new SfxTbxCtrlFactArr_Impl; pImpl->pTbxCtrlFac = new SfxTbxCtrlFactArr_Impl;
...@@ -242,20 +242,20 @@ void SfxModule::RegisterToolBoxControl( SfxTbxCtrlFactory *pFact ) ...@@ -242,20 +242,20 @@ void SfxModule::RegisterToolBoxControl( SfxTbxCtrlFactory *pFact )
for ( size_t n=0; n<pImpl->pTbxCtrlFac->size(); n++ ) for ( size_t n=0; n<pImpl->pTbxCtrlFac->size(); n++ )
{ {
SfxTbxCtrlFactory *pF = &(*pImpl->pTbxCtrlFac)[n]; SfxTbxCtrlFactory *pF = &(*pImpl->pTbxCtrlFac)[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", "TbxController-Registering is not clearly defined!"); SAL_INFO("sfx2.appl", "TbxController-Registering is not clearly defined!");
} }
} }
#endif #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) if (!pImpl->pStbCtrlFac)
pImpl->pStbCtrlFac = new SfxStbCtrlFactArr_Impl; pImpl->pStbCtrlFac = new SfxStbCtrlFactArr_Impl;
...@@ -264,15 +264,15 @@ void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact ) ...@@ -264,15 +264,15 @@ void SfxModule::RegisterStatusBarControl( SfxStbCtrlFactory *pFact )
for ( size_t n=0; n<pImpl->pStbCtrlFac->size(); n++ ) for ( size_t n=0; n<pImpl->pStbCtrlFac->size(); n++ )
{ {
SfxStbCtrlFactory *pF = &(*pImpl->pStbCtrlFac)[n]; SfxStbCtrlFactory *pF = &(*pImpl->pStbCtrlFac)[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", "TbxController-Registering is not clearly defined!"); SAL_INFO("sfx2.appl", "TbxController-Registering is not clearly defined!");
} }
} }
#endif #endif
pImpl->pStbCtrlFac->push_back( pFact ); pImpl->pStbCtrlFac->push_back( rFact );
} }
......
...@@ -49,7 +49,7 @@ SfxStbCtrlFactory& SfxStbCtrlFactArr_Impl::operator []( size_t i ) ...@@ -49,7 +49,7 @@ SfxStbCtrlFactory& SfxStbCtrlFactArr_Impl::operator []( size_t i )
return maData[i]; return maData[i];
} }
void SfxStbCtrlFactArr_Impl::push_back( SfxStbCtrlFactory* p ) void SfxStbCtrlFactArr_Impl::push_back( const SfxStbCtrlFactory& p )
{ {
maData.push_back(p); maData.push_back(p);
} }
...@@ -69,7 +69,7 @@ SfxTbxCtrlFactory& SfxTbxCtrlFactArr_Impl::operator []( size_t i ) ...@@ -69,7 +69,7 @@ SfxTbxCtrlFactory& SfxTbxCtrlFactArr_Impl::operator []( size_t i )
return maData[i]; return maData[i];
} }
void SfxTbxCtrlFactArr_Impl::push_back( SfxTbxCtrlFactory* p ) void SfxTbxCtrlFactArr_Impl::push_back( const SfxTbxCtrlFactory& p )
{ {
maData.push_back(p); maData.push_back(p);
} }
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include <sfx2/stbitem.hxx> #include <sfx2/stbitem.hxx>
#include <sfx2/tbxctrl.hxx> #include <sfx2/tbxctrl.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
#include <vector> #include <vector>
class SfxMenuCtrlFactArr_Impl class SfxMenuCtrlFactArr_Impl
...@@ -43,28 +42,28 @@ public: ...@@ -43,28 +42,28 @@ public:
class SfxStbCtrlFactArr_Impl class SfxStbCtrlFactArr_Impl
{ {
typedef boost::ptr_vector<SfxStbCtrlFactory> DataType; typedef std::vector<SfxStbCtrlFactory> DataType;
DataType maData; DataType maData;
public: public:
const SfxStbCtrlFactory& operator []( size_t i ) const; const SfxStbCtrlFactory& operator []( size_t i ) const;
SfxStbCtrlFactory& operator []( size_t i ); SfxStbCtrlFactory& operator []( size_t i );
void push_back( SfxStbCtrlFactory* p ); void push_back( const SfxStbCtrlFactory& );
size_t size() const; size_t size() const;
}; };
class SfxTbxCtrlFactArr_Impl class SfxTbxCtrlFactArr_Impl
{ {
typedef boost::ptr_vector<SfxTbxCtrlFactory> DataType; typedef std::vector<SfxTbxCtrlFactory> DataType;
DataType maData; DataType maData;
public: public:
const SfxTbxCtrlFactory& operator []( size_t i ) const; const SfxTbxCtrlFactory& operator []( size_t i ) const;
SfxTbxCtrlFactory& operator []( size_t i ); SfxTbxCtrlFactory& operator []( size_t i );
void push_back( SfxTbxCtrlFactory* p ); void push_back( const SfxTbxCtrlFactory& );
size_t size() const; size_t size() const;
}; };
......
...@@ -633,9 +633,9 @@ SfxStatusBarControl* SfxStatusBarControl::CreateControl ...@@ -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 );
} }
......
...@@ -272,9 +272,9 @@ void SAL_CALL SfxToolBoxControl::dispose() throw (css::uno::RuntimeException, st ...@@ -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 ) SfxToolBoxControl* SfxToolBoxControl::CreateControl( sal_uInt16 nSlotId, sal_uInt16 nTbxId, ToolBox *pBox, SfxModule* pMod )
......
...@@ -2799,13 +2799,13 @@ SfxToolBoxControl* SvxColorToolBoxControl::CreateImpl( sal_uInt16 nSlotId, sal_u ...@@ -2799,13 +2799,13 @@ SfxToolBoxControl* SvxColorToolBoxControl::CreateImpl( sal_uInt16 nSlotId, sal_u
void SvxColorToolBoxControl::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod) void SvxColorToolBoxControl::RegisterControl(sal_uInt16 nSlotId, SfxModule *pMod)
{ {
if ( nSlotId == SID_ATTR_LINE_COLOR ) if ( nSlotId == SID_ATTR_LINE_COLOR )
SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, typeid(XLineColorItem), nSlotId ) ); SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, typeid(XLineColorItem), nSlotId ) );
else if ( nSlotId == SID_ATTR_FILL_COLOR ) else if ( nSlotId == SID_ATTR_FILL_COLOR )
SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, typeid(XFillColorItem), nSlotId ) ); SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, typeid(XFillColorItem), nSlotId ) );
else if ( nSlotId == SID_ATTR_CHAR_BACK_COLOR ) else if ( nSlotId == SID_ATTR_CHAR_BACK_COLOR )
SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, typeid(SvxBackgroundColorItem), nSlotId ) ); SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, typeid(SvxBackgroundColorItem), nSlotId ) );
else else
SfxToolBoxControl::RegisterToolBoxControl( pMod, new SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, typeid(SvxColorItem), nSlotId ) ); SfxToolBoxControl::RegisterToolBoxControl( pMod, SfxTbxCtrlFactory( SvxColorToolBoxControl::CreateImpl, typeid(SvxColorItem), nSlotId ) );
} }
// class SvxFrameToolBoxControl -------------------------------------------- // class SvxFrameToolBoxControl --------------------------------------------
......
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