diff options
author | Noel Grandin <noel@peralex.com> | 2012-06-28 11:02:42 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-07-04 23:23:22 +0200 |
commit | ebde6c7e3e816980dfe32086783a165f3d0019b1 (patch) | |
tree | 03d4bf793e73cef523937021d593d3d460436da2 /svtools/inc | |
parent | a87c24fcfe1d8842d892185d6f9f2e07c52c3804 (diff) |
Convert aItems field of SvLBoxEntry class from SvPtrarr to std::vector
Change-Id: I96d676ded52ebdf0f68b051b06cecf717d56e813
Diffstat (limited to 'svtools/inc')
-rw-r--r-- | svtools/inc/svtools/svlbox.hxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/svtools/inc/svtools/svlbox.hxx b/svtools/inc/svtools/svlbox.hxx index 92aa9460e692..ea18d052dbfd 100644 --- a/svtools/inc/svtools/svlbox.hxx +++ b/svtools/inc/svtools/svlbox.hxx @@ -183,24 +183,28 @@ class SVT_DLLPUBLIC SvLBoxEntry : public SvListEntry { friend class SvLBox; - SvPtrarr aItems; - void* pUserData; - sal_uInt16 nEntryFlags; + std::vector<SvLBoxItem*> aItems; + void* pUserData; + sal_uInt16 nEntryFlags; SVT_DLLPRIVATE void DeleteItems_Impl(); public: SvLBoxEntry(); virtual ~SvLBoxEntry(); - sal_uInt16 ItemCount() const { return (sal_uInt16)aItems.Count(); } + sal_uInt16 ItemCount() const { return (sal_uInt16)aItems.size(); } // DARF NUR GERUFEN WERDEN, WENN DER EINTRAG NOCH NICHT IM MODEL // EINGEFUEGT IST, DA SONST FUER DAS ITEM KEINE VIEW-ABHAENGIGEN // DATEN ALLOZIERT WERDEN! void AddItem( SvLBoxItem* pItem ); void ReplaceItem( SvLBoxItem* pNewItem, sal_uInt16 nPos ); - SvLBoxItem* GetItem( sal_uInt16 nPos ) const { return (SvLBoxItem*)aItems.GetObject(nPos ); } + SvLBoxItem* GetItem( sal_uInt16 nPos ) const { return aItems[nPos]; } SvLBoxItem* GetFirstItem( sal_uInt16 nId ); - sal_uInt16 GetPos( SvLBoxItem* pItem ) const { return aItems.GetPos( pItem ); } + sal_uInt16 GetPos( SvLBoxItem* pItem ) const + { + std::vector<SvLBoxItem*>::const_iterator it = std::find( aItems.begin(), aItems.end(), pItem ); + return it == aItems.end() ? USHRT_MAX : it - aItems.begin(); + } void* GetUserData() const { return pUserData; } void SetUserData( void* pPtr ) { pUserData = pPtr; } virtual void Clone( SvListEntry* pSource ); |