From cfd1310bef1f8c61b53fa0343f95da4abae0f583 Mon Sep 17 00:00:00 2001 From: Takeshi Abe Date: Sat, 27 Sep 2014 23:51:21 +0900 Subject: fdo#75757: remove inheritance to std::vector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit from SfxVerbSlotArr_Impl. Change-Id: I84582f10095638a0fef82aa46f721d57a8b27c27 Reviewed-on: https://gerrit.libreoffice.org/11662 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sfx2/source/control/shell.cxx | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx index f722a2cd04d6..29b2d1a3ee86 100644 --- a/sfx2/source/control/shell.cxx +++ b/sfx2/source/control/shell.cxx @@ -45,6 +45,7 @@ #include #include +#include // Maps the Which() field to a pointer to a SfxPoolItem class SfxItemPtrMap : public std::map @@ -59,15 +60,7 @@ public: TYPEINIT0(SfxShell); -class SfxVerbSlotArr_Impl : public std::vector -{ -public: - ~SfxVerbSlotArr_Impl() - { - for(const_iterator it = begin(); it != end(); ++it) - delete *it; - } -}; +typedef boost::ptr_vector SfxVerbSlotArr_Impl; using namespace com::sun::star; @@ -592,9 +585,9 @@ void SfxShell::SetVerbs(const com::sun::star::uno::Sequence < com::sun::star::em if (!pImp->aSlotArr.empty()) { - SfxSlot *pSlot = pImp->aSlotArr[0]; - pNewSlot->pNextSlot = pSlot->pNextSlot; - pSlot->pNextSlot = pNewSlot; + SfxSlot& rSlot = pImp->aSlotArr[0]; + pNewSlot->pNextSlot = rSlot.pNextSlot; + rSlot.pNextSlot = pNewSlot; } else pNewSlot->pNextSlot = pNewSlot; @@ -660,7 +653,7 @@ const SfxSlot* SfxShell::GetVerbSlot_Impl(sal_uInt16 nId) const DBG_ASSERT(nIndex < rList.getLength(),"Wrong VerbId!"); if (nIndex < rList.getLength()) - return pImp->aSlotArr[nIndex]; + return &pImp->aSlotArr[nIndex]; else return 0; } -- cgit