[Libreoffice-commits] core.git: sfx2/source
Takeshi Abe
tabe at fixedpoint.jp
Sun Sep 28 10:45:36 PDT 2014
sfx2/source/control/shell.cxx | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
New commits:
commit cfd1310bef1f8c61b53fa0343f95da4abae0f583
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date: Sat Sep 27 23:51:21 2014 +0900
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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index f722a2c..29b2d1a 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;
}
More information about the Libreoffice-commits
mailing list