From c4984cbfafae189a4675e8619ba836f2ab2adb38 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 15 Aug 2012 14:15:40 +0200 Subject: Convert aList in SdrObjRefList class from Container to std::vector Change-Id: Iee505825f46434b09c73679e1439f99afc631336 --- svx/source/svdraw/svdfmtf.hxx | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'svx') diff --git a/svx/source/svdraw/svdfmtf.hxx b/svx/source/svdraw/svdfmtf.hxx index 85bebfbc3343..ceead0de48b0 100644 --- a/svx/source/svdraw/svdfmtf.hxx +++ b/svx/source/svdraw/svdfmtf.hxx @@ -51,19 +51,26 @@ class SvdProgressInfo; class SdrObjRefList { - Container aList; + std::vector aList; public: SdrObjRefList() - : aList(1024,64,64) + : aList() {} - void Clear() { aList.Clear(); } - sal_uLong GetObjCount() const { return aList.Count(); } - SdrObject* GetObj(sal_uLong nNum) const { return (SdrObject*)aList.GetObject(nNum); } - SdrObject* operator[](sal_uLong nNum) const { return (SdrObject*)aList.GetObject(nNum); } - void InsertObject(SdrObject* pObj, sal_uLong nPos=CONTAINER_APPEND) { aList.Insert(pObj,nPos); } - void RemoveObject(sal_uLong nPos) { aList.Remove(nPos); } + void Clear() { aList.clear(); } + sal_uLong GetObjCount() const { return aList.size(); } + SdrObject* GetObj(sal_uLong nNum) const { return aList[nNum]; } + SdrObject* operator[](sal_uLong nNum) const { return aList[nNum]; } + void InsertObject(SdrObject* pObj) { aList.push_back(pObj); } + void InsertObject(SdrObject* pObj, sal_uLong nPos) + { + if(nPos==CONTAINER_APPEND) + aList.push_back(pObj); + else + aList.insert(aList.begin() + nPos, pObj); + } + void RemoveObject(sal_uLong nPos) { aList.erase(aList.begin()+nPos); } }; //************************************************************ -- cgit