diff options
author | Noel Grandin <noel@peralex.com> | 2014-01-10 10:53:06 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-01-20 13:14:31 +0200 |
commit | 22b928d7d7e03e0a8506263ae556a0e3d15b0d86 (patch) | |
tree | 992fa1972990bb934a4f773187f31c9e70c772c5 /scaddins | |
parent | 4cc5d3f2d720e9900c6a58880bb979da81326166 (diff) |
convert custom list implementation FuncDataList to use std::vector
Change-Id: Id73464d135dd41e6a24663da654a3c623c2814d4
Diffstat (limited to 'scaddins')
-rw-r--r-- | scaddins/source/analysis/analysishelper.cxx | 4 | ||||
-rw-r--r-- | scaddins/source/analysis/analysishelper.hxx | 14 |
2 files changed, 10 insertions, 8 deletions
diff --git a/scaddins/source/analysis/analysishelper.cxx b/scaddins/source/analysis/analysishelper.cxx index d9e7a422946d..bade2db20289 100644 --- a/scaddins/source/analysis/analysishelper.cxx +++ b/scaddins/source/analysis/analysishelper.cxx @@ -1508,8 +1508,8 @@ FuncDataList::FuncDataList( ResMgr& rResMgr ) FuncDataList::~FuncDataList() { - for( FuncData* p = ( FuncData* ) First() ; p ; p = ( FuncData* ) Next() ) - delete p; + for( std::vector<FuncData*>::iterator it = maVector.begin(); it != maVector.end(); ++it ) + delete *it; } diff --git a/scaddins/source/analysis/analysishelper.hxx b/scaddins/source/analysis/analysishelper.hxx index 85dc8f5dab96..1208b36ec57d 100644 --- a/scaddins/source/analysis/analysishelper.hxx +++ b/scaddins/source/analysis/analysishelper.hxx @@ -237,17 +237,19 @@ public: -class FuncDataList : private MyList +class FuncDataList { - OUString aLastName; + OUString aLastName; sal_uInt32 nLast; + std::vector<FuncData*> maVector; public: FuncDataList( ResMgr& ); virtual ~FuncDataList(); - using MyList::Append; + inline void Append( FuncData* pNew ); inline const FuncData* Get( sal_uInt32 nIndex ) const; - using MyList::Count; + inline sal_uInt32 Count() const + { return maVector.size(); } const FuncData* Get( const OUString& aProgrammaticName ) const; }; @@ -712,13 +714,13 @@ inline FDCategory FuncData::GetCategory( void ) const inline void FuncDataList::Append( FuncData* p ) { - MyList::Append( p ); + maVector.push_back( p ); } inline const FuncData* FuncDataList::Get( sal_uInt32 n ) const { - return ( const FuncData* ) MyList::GetObject( n ); + return maVector[n]; } |