diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-10-02 12:19:19 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2013-10-04 19:15:22 -0400 |
commit | b3674c9291a09c4e278a0875b691fc7aaf3f38cd (patch) | |
tree | 3f78b48f1e00366f1228f83b136bed8eedff1aaf /svl/source | |
parent | 4d076d4ceeb05061b6b0699c19af9ba5ed0fcd00 (diff) |
Let's not expose the internal pointer. Define different ID type.
To prevent the string ID's from being used to instantiate string objects,
which can mess up shared string object's life cycles.
Change-Id: Ibcd9a4fa9f591d5c27a9e1b50bc9f83ae230e86a
Diffstat (limited to 'svl/source')
-rw-r--r-- | svl/source/misc/stringpool.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/svl/source/misc/stringpool.cxx b/svl/source/misc/stringpool.cxx index 1181538e4ecf..c0030fefa2cd 100644 --- a/svl/source/misc/stringpool.cxx +++ b/svl/source/misc/stringpool.cxx @@ -46,20 +46,20 @@ rtl_uString* StringPool::intern( const OUString& rStr ) return pOrig; } -const rtl_uString* StringPool::getIdentifier( const OUString& rStr ) const +StringPool::StrIdType StringPool::getIdentifier( const OUString& rStr ) const { StrHashType::iterator it = maStrPool.find(rStr); - return (it == maStrPool.end()) ? NULL : it->pData; + return (it == maStrPool.end()) ? 0 : reinterpret_cast<StrIdType>(it->pData); } -const rtl_uString* StringPool::getIdentifierIgnoreCase( const OUString& rStr ) const +StringPool::StrIdType StringPool::getIdentifierIgnoreCase( const OUString& rStr ) const { if (!mpCharClass) - return NULL; + return 0; OUString aUpper = mpCharClass->uppercase(rStr); StrHashType::iterator it = maStrPoolUpper.find(aUpper); - return (it == maStrPool.end()) ? NULL : it->pData; + return (it == maStrPool.end()) ? 0 : reinterpret_cast<StrIdType>(it->pData); } StringPool::InsertResultType StringPool::findOrInsert( StrHashType& rPool, const OUString& rStr ) const |