diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-03-08 11:22:27 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-03-08 11:22:27 +0000 |
commit | 2ecf0d3dfd98149a7dfb573787a5f81971800ed6 (patch) | |
tree | 5698af5cd4f5be149f8fb29bbdf4a238fdc7493f /sw/inc/SwStyleNameMapper.hxx | |
parent | 7a2e139e8554566de25faf25c412cfaa5406a7d9 (diff) |
INTEGRATION: CWS swnum01 (1.4.136); FILE MERGED
2003/09/12 13:02:52 hbrinkm 1.4.136.1: #111955
Diffstat (limited to 'sw/inc/SwStyleNameMapper.hxx')
-rw-r--r-- | sw/inc/SwStyleNameMapper.hxx | 54 |
1 files changed, 3 insertions, 51 deletions
diff --git a/sw/inc/SwStyleNameMapper.hxx b/sw/inc/SwStyleNameMapper.hxx index 2db608ed9fd7..5894f2f7e504 100644 --- a/sw/inc/SwStyleNameMapper.hxx +++ b/sw/inc/SwStyleNameMapper.hxx @@ -2,9 +2,9 @@ * * $RCSfile: SwStyleNameMapper.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: hr $ $Date: 2003-03-27 15:38:29 $ + * last change: $Author: hr $ $Date: 2004-03-08 12:22:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -71,6 +71,7 @@ #include <tools/string.hxx> #endif #include <hash_map> +#include <stringhash.hxx> /* This class holds all data about the names of styles used in the user @@ -120,55 +121,6 @@ class SvStringsDtor; class String; struct SwTableEntry; -struct StringEq -{ - sal_Bool operator() ( const String *r1, - const String *r2) const - { - return r1->Equals(*r2); - } -}; - -struct StringHash -{ - size_t operator() ( const String *rString) const - { - sal_Int32 h, nLen; - h = nLen = rString->Len(); - const sal_Unicode *pStr = rString->GetBuffer(); - - if ( nLen < 16 ) - while ( nLen-- > 0 ) - h = (h*37) + *(pStr++); - else - { - sal_Int32 nSkip; - const sal_Unicode* pEndStr = pStr+nLen-5; - - /* only sample some characters */ - /* the first 3, some characters between, and the last 5 */ - h = (h*39) + *(pStr++); - h = (h*39) + *(pStr++); - h = (h*39) + *(pStr++); - - nSkip = nLen / nLen < 32 ? 4 : 8; - nLen -= 8; - while ( nLen > 0 ) - { - h = (h*39) + ( *pStr ); - pStr += nSkip; - nLen -= nSkip; - } - - h = (h*39) + *(pEndStr++); - h = (h*39) + *(pEndStr++); - h = (h*39) + *(pEndStr++); - h = (h*39) + *(pEndStr++); - h = (h*39) + *(pEndStr++); - } - return h; - } -}; typedef ::std::hash_map < const String*, sal_uInt16, StringHash, StringEq > NameToIdHash; |