diff options
author | Eike Rathke <er@openoffice.org> | 2002-11-19 21:08:22 +0000 |
---|---|---|
committer | Eike Rathke <er@openoffice.org> | 2002-11-19 21:08:22 +0000 |
commit | 7c5090df6531d6ae0e9e0996bb0d368d1c00b580 (patch) | |
tree | 5b52116830b1a1acbd35a76abbe11fd8e5d8af45 /sc/inc/addincol.hxx | |
parent | 95b054fe44d0f0fbb4e27d4c50286a88ec56b31d (diff) |
#i2800# #99677# performance: use hash maps
Diffstat (limited to 'sc/inc/addincol.hxx')
-rw-r--r-- | sc/inc/addincol.hxx | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/sc/inc/addincol.hxx b/sc/inc/addincol.hxx index b555e1f44d47..23062ea22941 100644 --- a/sc/inc/addincol.hxx +++ b/sc/inc/addincol.hxx @@ -2,9 +2,9 @@ * * $RCSfile: addincol.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: gt $ $Date: 2001-02-13 14:37:23 $ + * last change: $Author: er $ $Date: 2002-11-19 22:05:18 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -87,6 +87,13 @@ #include <tools/lang.hxx> #endif +#ifndef _RTL_USTRING_H_ +#include <rtl/ustring.h> +#endif + +#include <hash_map> + + class String; class SfxObjectShell; class ScUnoAddInFuncData; @@ -94,6 +101,16 @@ class ScMatrix; class ScFuncDesc; +struct ScAddInStringHashCode +{ + size_t operator()( const String& rStr ) const + { + return rtl_ustr_hashCode_WithLength( rStr.GetBuffer(), rStr.Len() ); + } +}; +typedef ::std::hash_map< String, const ScUnoAddInFuncData*, ScAddInStringHashCode, ::std::equal_to< String > > ScAddInHashMap; + + enum ScAddInArgumentType { SC_ADDINARG_NONE, // - @@ -116,6 +133,9 @@ class ScUnoAddInCollection private: long nFuncCount; ScUnoAddInFuncData** ppFuncData; + ScAddInHashMap* pExactHashMap; // exact internal name + ScAddInHashMap* pNameHashMap; // internal name upper + ScAddInHashMap* pLocalHashMap; // localized name upper BOOL bInitialized; void Initialize(); @@ -127,7 +147,7 @@ public: ~ScUnoAddInCollection(); String FindFunction( const String& rName, BOOL bLocalFirst ); // user entered name - ScUnoAddInFuncData* GetFuncData( const String& rName ); // exact name + const ScUnoAddInFuncData* GetFuncData( const String& rName ); // exact name void LocalizeString( String& rName ); // modify rName - input: exact name |