diff options
author | Noel Grandin <noel@peralex.com> | 2012-08-15 13:29:19 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-08-16 18:44:04 +0200 |
commit | e5da8190e0edc476eecfe4f49aae4b50a480e414 (patch) | |
tree | 3d61fda74b83d6b43cd2ebf66649c3e7c2fee814 /svx | |
parent | Convert maPages field in SdrModel class from Container to std::vector (diff) | |
download | core-e5da8190e0edc476eecfe4f49aae4b50a480e414.tar.gz core-e5da8190e0edc476eecfe4f49aae4b50a480e414.zip |
Convert field from Container to std::vector in SdrPageGridFrameList
Change-Id: I5940936e986b2f6580ca9ce973359d8179631f8c
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/svx/fmpage.hxx | 1 | ||||
-rw-r--r-- | svx/inc/svx/svdpage.hxx | 36 | ||||
-rw-r--r-- | svx/source/svdraw/svdpage.cxx | 2 |
3 files changed, 28 insertions, 11 deletions
diff --git a/svx/inc/svx/fmpage.hxx b/svx/inc/svx/fmpage.hxx index 0b25888b2a6e..7341063facdf 100644 --- a/svx/inc/svx/fmpage.hxx +++ b/svx/inc/svx/fmpage.hxx @@ -32,6 +32,7 @@ #include <svx/svdpage.hxx> #include <comphelper/uno3.hxx> #include "svx/svxdllapi.h" +#include <tools/contnr.hxx> class StarBASIC; class FmFormModel; diff --git a/svx/inc/svx/svdpage.hxx b/svx/inc/svx/svdpage.hxx index 892e758218ea..5ab0f5ab916a 100644 --- a/svx/inc/svx/svdpage.hxx +++ b/svx/inc/svx/svdpage.hxx @@ -33,7 +33,6 @@ #include <vcl/print.hxx> #include <vcl/gdimtf.hxx> #include <tools/weakbase.hxx> -#include <tools/contnr.hxx> #include <cppuhelper/weakref.hxx> #include <svx/svdtypes.hxx> #include <svx/svdlayer.hxx> @@ -133,10 +132,10 @@ public: // Neuberechnung der Objekt-Ordnungsnummern void RecalcObjOrdNums(); bool IsObjOrdNumsDirty() const { return bObjOrdNumsDirty; } - virtual void NbcInsertObject(SdrObject* pObj, sal_uIntPtr nPos=CONTAINER_APPEND + virtual void NbcInsertObject(SdrObject* pObj, sal_uIntPtr nPos=0xFFFF , const SdrInsertReason* pReason=NULL ); - virtual void InsertObject(SdrObject* pObj, sal_uIntPtr nPos=CONTAINER_APPEND + virtual void InsertObject(SdrObject* pObj, sal_uIntPtr nPos=0xFFFF , const SdrInsertReason* pReason=NULL ); // aus Liste entfernen ohne delete @@ -338,20 +337,37 @@ public: }; class SVX_DLLPUBLIC SdrPageGridFrameList { - Container aList; + std::vector<SdrPageGridFrame*> aList; private: SVX_DLLPRIVATE SdrPageGridFrameList(const SdrPageGridFrameList& rSrcList); // never implemented SVX_DLLPRIVATE void operator=(const SdrPageGridFrameList& rSrcList); // never implemented protected: - SdrPageGridFrame* GetObject(sal_uInt16 i) const { return (SdrPageGridFrame*)(aList.GetObject(i)); } + SdrPageGridFrame* GetObject(sal_uInt16 i) const { return aList[i]; } public: - SdrPageGridFrameList(): aList(1024,4,4) {} + SdrPageGridFrameList(): aList() {} ~SdrPageGridFrameList() { Clear(); } void Clear(); - sal_uInt16 GetCount() const { return sal_uInt16(aList.Count()); } - void Insert(const SdrPageGridFrame& rGF, sal_uInt16 nPos=0xFFFF) { aList.Insert(new SdrPageGridFrame(rGF),nPos); } - void Delete(sal_uInt16 nPos) { delete (SdrPageGridFrame*)aList.Remove(nPos); } - void Move(sal_uInt16 nPos, sal_uInt16 nNewPos) { aList.Insert(aList.Remove(nPos),nNewPos); } + sal_uInt16 GetCount() const { return sal_uInt16(aList.size()); } + void Insert(const SdrPageGridFrame& rGF) { aList.push_back(new SdrPageGridFrame(rGF)); } + void Insert(const SdrPageGridFrame& rGF, sal_uInt16 nPos) + { + if(nPos==0xFFFF) + aList.push_back(new SdrPageGridFrame(rGF)); + else + aList.insert(aList.begin()+nPos,new SdrPageGridFrame(rGF)); + } + void Delete(sal_uInt16 nPos) + { + SdrPageGridFrame* p = aList[nPos]; + aList.erase(aList.begin()+nPos); + delete p; + } + void Move(sal_uInt16 nPos, sal_uInt16 nNewPos) + { + SdrPageGridFrame* p = aList[nPos]; + aList.erase(aList.begin()+nPos); + aList.insert(aList.begin()+nNewPos,p); + } SdrPageGridFrame& operator[](sal_uInt16 nPos) { return *GetObject(nPos); } const SdrPageGridFrame& operator[](sal_uInt16 nPos) const { return *GetObject(nPos); } }; diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx index db88eb3b6b56..fffb8ed6c87b 100644 --- a/svx/source/svdraw/svdpage.cxx +++ b/svx/source/svdraw/svdpage.cxx @@ -1088,7 +1088,7 @@ void SdrPageGridFrameList::Clear() for (sal_uInt16 i=0; i<nAnz; i++) { delete GetObject(i); } - aList.Clear(); + aList.clear(); } ////////////////////////////////////////////////////////////////////////////// |