diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-10-02 11:29:42 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-10-04 19:15:22 -0400 |
commit | 4d076d4ceeb05061b6b0699c19af9ba5ed0fcd00 (patch) | |
tree | 1cca2e9da7b436a91addc3590d5a209e61129be7 /svl/source | |
parent | 5d3ea0cde3f4c61832c48281e75dabd22621a893 (diff) |
Write some rudimentary tests for the new shared string pool class.
Change-Id: Ie66de46d69f664839aa0a2d056cd3b8df4d4989b
Diffstat (limited to 'svl/source')
-rw-r--r-- | svl/source/misc/stringpool.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/svl/source/misc/stringpool.cxx b/svl/source/misc/stringpool.cxx index 46462d1e7a59..1181538e4ecf 100644 --- a/svl/source/misc/stringpool.cxx +++ b/svl/source/misc/stringpool.cxx @@ -13,7 +13,7 @@ namespace svl { StringPool::StringPool() : mpCharClass(NULL) {} -StringPool::StringPool( CharClass* pCharClass ) : mpCharClass(pCharClass) {} +StringPool::StringPool( const CharClass* pCharClass ) : mpCharClass(pCharClass) {} rtl_uString* StringPool::intern( const OUString& rStr ) { @@ -52,6 +52,16 @@ const rtl_uString* StringPool::getIdentifier( const OUString& rStr ) const return (it == maStrPool.end()) ? NULL : it->pData; } +const rtl_uString* StringPool::getIdentifierIgnoreCase( const OUString& rStr ) const +{ + if (!mpCharClass) + return NULL; + + OUString aUpper = mpCharClass->uppercase(rStr); + StrHashType::iterator it = maStrPoolUpper.find(aUpper); + return (it == maStrPool.end()) ? NULL : it->pData; +} + StringPool::InsertResultType StringPool::findOrInsert( StrHashType& rPool, const OUString& rStr ) const { StrHashType::iterator it = rPool.find(rStr); |