From 3f4482ebc2c3b260d42422efbee92c4210e35767 Mon Sep 17 00:00:00 2001 From: Ian Date: Wed, 12 Aug 2015 16:06:46 +0100 Subject: Removed another FuncDataList collection This time the existing collection used a vector internally and mapped operations onto its standard interface. Removing it in favour of a raw typedef'd vector and find_if reduces the volume of code and simplifies the lookup mechanism. Change-Id: I86fdb85773577019073803c2fc249d04196afe31 Reviewed-on: https://gerrit.libreoffice.org/17680 Reviewed-by: David Tardon Tested-by: David Tardon --- scaddins/source/analysis/analysishelper.hxx | 34 +++++++---------------------- 1 file changed, 8 insertions(+), 26 deletions(-) (limited to 'scaddins/source/analysis/analysishelper.hxx') diff --git a/scaddins/source/analysis/analysishelper.hxx b/scaddins/source/analysis/analysishelper.hxx index d82af307a9c5..c44ca470132b 100644 --- a/scaddins/source/analysis/analysishelper.hxx +++ b/scaddins/source/analysis/analysishelper.hxx @@ -201,22 +201,16 @@ public: inline FDCategory GetCategory() const; }; +typedef std::vector< FuncData > FuncDataList; -class FuncDataList -{ - OUString aLastName; - sal_uInt32 nLast; - std::vector maVector; -public: - FuncDataList( ResMgr& ); - virtual ~FuncDataList(); - - inline void Append( FuncData* pNew ); - inline const FuncData* Get( sal_uInt32 nIndex ) const; - inline sal_uInt32 Count() const - { return maVector.size(); } +void InitFuncDataList ( FuncDataList& rList, ResMgr& rResMgr ); - const FuncData* Get( const OUString& aProgrammaticName ) const; +// Predicate for use with std::find_if +struct FindFuncData +{ + const OUString& m_rId; + explicit FindFuncData( const OUString& rId ) : m_rId(rId) {} + bool operator() ( FuncData& rCandidate ) const { return rCandidate.Is(m_rId); } }; class AnalysisResId : public ResId @@ -589,18 +583,6 @@ inline FDCategory FuncData::GetCategory() const } -inline void FuncDataList::Append( FuncData* p ) -{ - maVector.push_back( p ); -} - - -inline const FuncData* FuncDataList::Get( sal_uInt32 n ) const -{ - return maVector[n]; -} - - inline Complex::Complex( double fReal, double fImag, sal_Unicode cC ) : r( fReal ), i( fImag ), c( cC ) { -- cgit