diff options
author | Noel Grandin <noel@peralex.com> | 2012-08-14 11:01:38 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-08-16 15:14:57 +0200 |
commit | 62035e55b4128a5bf391c45160e0be5347fa23ae (patch) | |
tree | c4eecf9d76584c8730b8121fc45f6ab8f2dddd63 /svx/source/svdraw | |
parent | 028b34d93be5b794a195df518741ed67f9afdc09 (diff) |
Convert aList field in SdrLinkList class from Container to std::vector
Change-Id: Idf07339186827fb57ded1586108f1a4a49069f42
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r-- | svx/source/svdraw/svdetc.cxx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx index e43b55b0269f..fb3a18869f77 100644 --- a/svx/source/svdraw/svdetc.cxx +++ b/svx/source/svdraw/svdetc.cxx @@ -290,9 +290,9 @@ void SdrLinkList::Clear() { unsigned nAnz=GetLinkCount(); for (unsigned i=0; i<nAnz; i++) { - delete (Link*)aList.GetObject(i); + delete aList[i]; } - aList.Clear(); + aList.clear(); } unsigned SdrLinkList::FindEntry(const Link& rLink) const @@ -309,7 +309,10 @@ void SdrLinkList::InsertLink(const Link& rLink, unsigned nPos) unsigned nFnd=FindEntry(rLink); if (nFnd==0xFFFF) { if (rLink.IsSet()) { - aList.Insert(new Link(rLink),nPos); + if(nPos==0xFFFF) + aList.push_back(new Link(rLink)); + else + aList.insert(aList.begin() + nPos, new Link(rLink)); } else { OSL_FAIL("SdrLinkList::InsertLink(): Tried to insert a link that was not set already."); } @@ -322,7 +325,8 @@ void SdrLinkList::RemoveLink(const Link& rLink) { unsigned nFnd=FindEntry(rLink); if (nFnd!=0xFFFF) { - Link* pLink=(Link*)aList.Remove(nFnd); + Link* pLink = aList[nFnd]; + aList.erase( aList.begin() + nFnd ); delete pLink; } else { OSL_FAIL("SdrLinkList::RemoveLink(): Link not found."); |