summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeshi Abe <tabe@fixedpoint.jp>2014-09-27 23:51:21 +0900
committerCaolán McNamara <caolanm@redhat.com>2014-09-28 17:45:04 +0000
commitcfd1310bef1f8c61b53fa0343f95da4abae0f583 (patch)
tree3807d3edfeb70b35bdbd27ff542ced20d3cd1c9c
parent1cf74f3a537d0d6821028477cc42bd079bfc4448 (diff)
fdo#75757: remove inheritance to std::vector
from SfxVerbSlotArr_Impl. Change-Id: I84582f10095638a0fef82aa46f721d57a8b27c27 Reviewed-on: https://gerrit.libreoffice.org/11662 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sfx2/source/control/shell.cxx19
1 files 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 <sidebar/ContextChangeBroadcaster.hxx>
#include <map>
+#include <boost/ptr_container/ptr_vector.hpp>
// Maps the Which() field to a pointer to a SfxPoolItem
class SfxItemPtrMap : public std::map<sal_uInt16, SfxPoolItem*>
@@ -59,15 +60,7 @@ public:
TYPEINIT0(SfxShell);
-class SfxVerbSlotArr_Impl : public std::vector<SfxSlot*>
-{
-public:
- ~SfxVerbSlotArr_Impl()
- {
- for(const_iterator it = begin(); it != end(); ++it)
- delete *it;
- }
-};
+typedef boost::ptr_vector<SfxSlot> 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;
}