diff options
author | Thies Pierdola <thiespierdola@gmail.com> | 2011-01-28 21:56:06 +0100 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-01-28 22:06:16 -0500 |
commit | 47b2ace9c4189e35d43b8f07d53dbaf1eb025b37 (patch) | |
tree | 987287346db727d137ea9112c04038cd57914162 /sc/inc/funcdesc.hxx | |
parent | cc57c04130b9b58f4d4797f318be32fd45fa44eb (diff) |
Replaced tools/list by std::vector in ScFunctionList
As the random access Get is called a couple of thousand times each time
a spreadsheet function is used, the use of vector should have a huge
performance gain.
Diffstat (limited to 'sc/inc/funcdesc.hxx')
-rw-r--r-- | sc/inc/funcdesc.hxx | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/sc/inc/funcdesc.hxx b/sc/inc/funcdesc.hxx index 28fb16dcc3a0..fd4e1bc691f4 100644 --- a/sc/inc/funcdesc.hxx +++ b/sc/inc/funcdesc.hxx @@ -29,14 +29,10 @@ #ifndef SC_FUNCDESC_HXX #define SC_FUNCDESC_HXX -/* Function descriptions for function wizard / autopilot / most recent used - * list et al. Separated from the global.hxx lump, implementation still in - * global.cxx - */ +/* Function descriptions for function wizard / autopilot */ #include "scfuncs.hrc" -#include <tools/list.hxx> #include <formula/IFunctionDescription.hxx> #include <sal/types.h> #include <rtl/ustring.hxx> @@ -240,26 +236,21 @@ public: ScFunctionList(); ~ScFunctionList(); - sal_uInt32 GetCount() const - { return aFunctionList.Count(); } + sal_uInt32 GetCount() const + { return aFunctionList.size(); } - const ScFuncDesc* First() - { return (const ScFuncDesc*) aFunctionList.First(); } + const ScFuncDesc* First(); - const ScFuncDesc* Next() - { return (const ScFuncDesc*) aFunctionList.Next(); } + const ScFuncDesc* Next(); - const ScFuncDesc* GetFunction( sal_uInt32 nIndex ) const - { return static_cast<const ScFuncDesc*>(aFunctionList.GetObject(nIndex)); } + const ScFuncDesc* GetFunction( sal_uInt32 nIndex ) const; - ScFuncDesc* GetFunction( sal_uInt32 nIndex ) - { return static_cast<ScFuncDesc*>(aFunctionList.GetObject(nIndex)); } - - xub_StrLen GetMaxFuncNameLen() const - { return nMaxFuncNameLen; } + xub_StrLen GetMaxFuncNameLen() const + { return nMaxFuncNameLen; } private: - List aFunctionList; /**< List of functions */ + ::std::vector<const ScFuncDesc*> aFunctionList; /**< List of functions */ + ::std::vector<const ScFuncDesc*>::iterator aFunctionListIter; /**< position in function list */ xub_StrLen nMaxFuncNameLen; /**< Length of longest function name */ }; |