Index: source/com/sun/star/help/HelpLinker.cxx =================================================================== RCS file: /cvs/util/xmlhelp/source/com/sun/star/help/HelpLinker.cxx,v retrieving revision 1.5 diff -u -r1.5 HelpLinker.cxx --- source/com/sun/star/help/HelpLinker.cxx 29 Jun 2007 17:09:25 -0000 1.5 +++ source/com/sun/star/help/HelpLinker.cxx 12 Jul 2007 08:59:59 -0000 @@ -1531,17 +1531,9 @@ return ent; } -void FullBtreeDict::store(const std::string &bla, int id) +void FullBtreeDict::store(const std::string &key, int id) { - HCDBG(std::cerr << "storing " << bla << " id " << id << std::endl); - /* - if (logging) - log.write(key + " " + id + "\n"); - */ - std::string key = bla; - int length = key.size(); - while(key.size() >= 250) - key = bla.substr(--length); + HCDBG(std::cerr << "so storing " << key << " id " << id << std::endl); if (key.size() >= 250) { @@ -2225,9 +2217,22 @@ } } +namespace +{ + std::string cliptoken(const std::string &name) + { + std::string key = name; + int length = key.size(); + while(key.size() >= 250) + key = name.substr(--length); + return key; + } +} + int Index::intern(const std::string &name) { - IndexHashtable::const_iterator aIter = _cache.find(name); + std::string key = cliptoken(name); + IndexHashtable::const_iterator aIter = _cache.find(key); if (aIter != _cache.end()) return aIter->second; else @@ -2235,15 +2240,9 @@ //Seeing as we always start off with an empty dictionary, //our entries will always be in the _cache, so don't ever //search the underlying dictionary -#if 0 - int id = _dict->fetch(name); - if (id == 0) - _dict->store(name, id = _freeID++); -#else int id = _freeID++; - _dict->store(name, id); -#endif - _cache.insert(IndexHashtable::value_type(name, id)).first->second = id; + _dict->store(key, id); + _cache.insert(IndexHashtable::value_type(key, id)).first->second = id; return id; } }