summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-08-15 10:49:33 +0200
committerMichael Stahl <mstahl@redhat.com>2012-08-16 15:14:59 +0200
commita6f60d546ac61bfd9db7fad06138512cde4acb5a (patch)
treed77ef1fea910a5374290b1d191af89ea4b589c38 /svx
parentdeb266708f4d3ab3c64c33e93c96f19479da7d95 (diff)
Convert aList in SdrGluePointList class from Container to std::vector
Change-Id: I401b01d5d1072262d0bd2b85298751c9180004d3
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/svx/svdglue.hxx19
-rw-r--r--svx/source/svdraw/svdfmtf.hxx1
-rw-r--r--svx/source/svdraw/svdglue.cxx4
3 files changed, 15 insertions, 9 deletions
diff --git a/svx/inc/svx/svdglue.hxx b/svx/inc/svx/svdglue.hxx
index c6a58eb309f8..43fce9f1fb0d 100644
--- a/svx/inc/svx/svdglue.hxx
+++ b/svx/inc/svx/svdglue.hxx
@@ -34,9 +34,9 @@ class OutputDevice;
class SvStream;
class SdrObject;
-#include <tools/contnr.hxx>
#include <tools/gen.hxx>
#include "svx/svxdllapi.h"
+#include <vector>
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -116,20 +116,25 @@ public:
#define SDRGLUEPOINT_NOTFOUND 0xFFFF
class SVX_DLLPUBLIC SdrGluePointList {
- Container aList;
+ std::vector<SdrGluePoint*> aList;
protected:
- SdrGluePoint* GetObject(sal_uInt16 i) const { return (SdrGluePoint*)(aList.GetObject(i)); }
+ SdrGluePoint* GetObject(sal_uInt16 i) const { return aList[i]; }
public:
- SdrGluePointList(): aList(1024,4,4) {}
- SdrGluePointList(const SdrGluePointList& rSrcList): aList(1024,4,4) { *this=rSrcList; }
+ SdrGluePointList(): aList() {}
+ SdrGluePointList(const SdrGluePointList& rSrcList): aList() { *this=rSrcList; }
~SdrGluePointList() { Clear(); }
void Clear();
void operator=(const SdrGluePointList& rSrcList);
- sal_uInt16 GetCount() const { return sal_uInt16(aList.Count()); }
+ sal_uInt16 GetCount() const { return sal_uInt16(aList.size()); }
// Beim Insert wird dem Objekt (also dem GluePoint) automatisch eine Id zugewiesen.
// ReturnCode ist der Index des neuen GluePoints in der Liste
sal_uInt16 Insert(const SdrGluePoint& rGP);
- void Delete(sal_uInt16 nPos) { delete (SdrGluePoint*)aList.Remove(nPos); }
+ void Delete(sal_uInt16 nPos)
+ {
+ SdrGluePoint* p = aList[nPos];
+ aList.erase(aList.begin()+nPos);
+ delete p;
+ }
SdrGluePoint& operator[](sal_uInt16 nPos) { return *GetObject(nPos); }
const SdrGluePoint& operator[](sal_uInt16 nPos) const { return *GetObject(nPos); }
sal_uInt16 FindGluePoint(sal_uInt16 nId) const;
diff --git a/svx/source/svdraw/svdfmtf.hxx b/svx/source/svdraw/svdfmtf.hxx
index 96e12cb3f1df..85bebfbc3343 100644
--- a/svx/source/svdraw/svdfmtf.hxx
+++ b/svx/source/svdraw/svdfmtf.hxx
@@ -29,6 +29,7 @@
#ifndef _SVDFMTF_HXX
#define _SVDFMTF_HXX
+#include <tools/contnr.hxx>
#include <vcl/metaact.hxx>
#include <vcl/virdev.hxx>
#include <svx/svdobj.hxx>
diff --git a/svx/source/svdraw/svdglue.cxx b/svx/source/svdraw/svdglue.cxx
index 1490d377292e..911879dbee1e 100644
--- a/svx/source/svdraw/svdglue.cxx
+++ b/svx/source/svdraw/svdglue.cxx
@@ -277,7 +277,7 @@ void SdrGluePointList::Clear()
for (sal_uInt16 i=0; i<nAnz; i++) {
delete GetObject(i);
}
- aList.Clear();
+ aList.clear();
}
void SdrGluePointList::operator=(const SdrGluePointList& rSrcList)
@@ -320,7 +320,7 @@ sal_uInt16 SdrGluePointList::Insert(const SdrGluePoint& rGP)
}
pGP->SetId(nId);
}
- aList.Insert(pGP,nInsPos);
+ aList.insert(aList.begin()+nInsPos, pGP);
return nInsPos;
}