sfx2: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: I6a0b9d539489b7774c3437871f31fd28e737c901
This commit is contained in:
parent
10629489d3
commit
c8b2f752ce
@ -44,7 +44,6 @@
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/ptr_container/ptr_map.hpp>
|
||||
#include <boost/ptr_container/ptr_vector.hpp>
|
||||
#include <memory>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#include <cassert>
|
||||
|
@ -19,14 +19,15 @@
|
||||
#ifndef INCLUDED_SFX2_SOURCE_INC_VIRTMENU_HXX
|
||||
#define INCLUDED_SFX2_SOURCE_INC_VIRTMENU_HXX
|
||||
|
||||
#include <boost/ptr_container/ptr_vector.hpp>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
#include <sfx2/mnuitem.hxx>
|
||||
|
||||
class SfxBindings;
|
||||
class SfxMenuImageControl_Impl;
|
||||
|
||||
typedef ::boost::ptr_vector<SfxMenuControl> SfxMenuCtrlArr_Impl;
|
||||
typedef std::vector<std::unique_ptr<SfxMenuControl> > SfxMenuCtrlArr_Impl;
|
||||
|
||||
class SAL_DLLPUBLIC_EXPORT SfxVirtualMenu
|
||||
{
|
||||
|
@ -366,7 +366,7 @@ void SfxVirtualMenu::CreateFromSVMenu()
|
||||
pPopup = nullptr;
|
||||
|
||||
SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
|
||||
rCtrlArr.push_back(pMnuCtrl);
|
||||
rCtrlArr.push_back(std::unique_ptr<SfxMenuControl>(pMnuCtrl));
|
||||
(pItems+nPos)->Bind( nullptr, nSlotId, sItemText, *pBindings);
|
||||
pMnuCtrl->Bind( this, nSlotId, sItemText, *pBindings);
|
||||
|
||||
@ -409,7 +409,7 @@ void SfxVirtualMenu::CreateFromSVMenu()
|
||||
if ( pMnuCtrl )
|
||||
{
|
||||
SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
|
||||
rCtrlArr.push_back(pMnuCtrl);
|
||||
rCtrlArr.push_back(std::unique_ptr<SfxMenuControl>(pMnuCtrl));
|
||||
(pItems+nPos)->Bind( nullptr, nSlotId, sItemText, *pBindings);
|
||||
}
|
||||
}
|
||||
@ -421,7 +421,7 @@ void SfxVirtualMenu::CreateFromSVMenu()
|
||||
if ( pMnuCtrl )
|
||||
{
|
||||
SfxMenuCtrlArr_Impl &rCtrlArr = GetAppCtrl_Impl();
|
||||
rCtrlArr.push_back(pMnuCtrl);
|
||||
rCtrlArr.push_back(std::unique_ptr<SfxMenuControl>(pMnuCtrl));
|
||||
(pItems+nPos)->Bind( nullptr, nSlotId, sItemText, *pBindings);
|
||||
}
|
||||
else
|
||||
@ -691,10 +691,10 @@ void SfxVirtualMenu::BindControllers()
|
||||
for (SfxMenuCtrlArr_Impl::iterator i = rCtrlArr.begin();
|
||||
i != rCtrlArr.end(); ++i)
|
||||
{
|
||||
sal_uInt16 nSlotId = i->GetId();
|
||||
sal_uInt16 nSlotId = (*i)->GetId();
|
||||
if (pSVMenu->GetItemCommand(nSlotId).isEmpty())
|
||||
{
|
||||
i->ReBind();
|
||||
(*i)->ReBind();
|
||||
}
|
||||
}
|
||||
|
||||
@ -718,10 +718,10 @@ void SfxVirtualMenu::UnbindControllers()
|
||||
for (SfxMenuCtrlArr_Impl::iterator i = rCtrlArr.begin();
|
||||
i != rCtrlArr.end(); ++i)
|
||||
{
|
||||
if (i->IsBound())
|
||||
if ((*i)->IsBound())
|
||||
{
|
||||
// UnoController is not bound!
|
||||
i->UnBind();
|
||||
(*i)->UnBind();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user