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:
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;
......
......@@ -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
......
......@@ -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,
......
......@@ -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: */
......@@ -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 );
}
......
......@@ -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);
}
......
......@@ -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;
};
......
......@@ -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 )
......
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