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

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

Change-Id: I6a0b9d539489b7774c3437871f31fd28e737c901
üst 10629489
......@@ -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();
}
}
......
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