Kaydet (Commit) 4aa41167 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Let's just use sal_uIntPtr straight.

So that the user of this class won't have to include the header just
to get the string ID type.

Change-Id: I0ccbc18fe02644f69701f57b0b1b9c30fd141d83
üst dc1314d9
...@@ -37,7 +37,6 @@ class SVL_DLLPUBLIC StringPool ...@@ -37,7 +37,6 @@ class SVL_DLLPUBLIC StringPool
const CharClass* mpCharClass; const CharClass* mpCharClass;
public: public:
typedef sal_uIntPtr StrIdType;
StringPool(); StringPool();
StringPool( const CharClass* pCharClass ); StringPool( const CharClass* pCharClass );
...@@ -61,7 +60,7 @@ public: ...@@ -61,7 +60,7 @@ public:
* *
* @return unique ID of the string object. * @return unique ID of the string object.
*/ */
StrIdType getIdentifier( const OUString& rStr ) const; sal_uIntPtr getIdentifier( const OUString& rStr ) const;
/** /**
* Get a unique ID of string object for case insensitive comparison. The * Get a unique ID of string object for case insensitive comparison. The
...@@ -72,7 +71,7 @@ public: ...@@ -72,7 +71,7 @@ public:
* @return unique ID of the string object usable for case insensitive * @return unique ID of the string object usable for case insensitive
* comparison. * comparison.
*/ */
StrIdType getIdentifierIgnoreCase( const OUString& rStr ) const; sal_uIntPtr getIdentifierIgnoreCase( const OUString& rStr ) const;
/** /**
* Go through all string objects in the pool, and clear those that are no * Go through all string objects in the pool, and clear those that are no
......
...@@ -309,8 +309,8 @@ void Test::testStringPool() ...@@ -309,8 +309,8 @@ void Test::testStringPool()
CPPUNIT_ASSERT_MESSAGE("They must differ.", p1 != p2); CPPUNIT_ASSERT_MESSAGE("They must differ.", p1 != p2);
OUString aAndy("Andy"); OUString aAndy("Andy");
svl::StringPool::StrIdType si1 = aPool.getIdentifier("Andy"); sal_uIntPtr si1 = aPool.getIdentifier("Andy");
svl::StringPool::StrIdType si2 = aPool.getIdentifier(aAndy); sal_uIntPtr si2 = aPool.getIdentifier(aAndy);
CPPUNIT_ASSERT_MESSAGE("Identifier shouldn't be 0.", si1); CPPUNIT_ASSERT_MESSAGE("Identifier shouldn't be 0.", si1);
CPPUNIT_ASSERT_MESSAGE("Identifier shouldn't be 0.", si2); CPPUNIT_ASSERT_MESSAGE("Identifier shouldn't be 0.", si2);
CPPUNIT_ASSERT_EQUAL(si1, si2); CPPUNIT_ASSERT_EQUAL(si1, si2);
......
...@@ -45,13 +45,13 @@ rtl_uString* StringPool::intern( const OUString& rStr ) ...@@ -45,13 +45,13 @@ rtl_uString* StringPool::intern( const OUString& rStr )
return pOrig; return pOrig;
} }
StringPool::StrIdType StringPool::getIdentifier( const OUString& rStr ) const sal_uIntPtr StringPool::getIdentifier( const OUString& rStr ) const
{ {
StrHashType::const_iterator it = maStrPool.find(rStr); StrHashType::const_iterator it = maStrPool.find(rStr);
return (it == maStrPool.end()) ? 0 : reinterpret_cast<StrIdType>(it->pData); return (it == maStrPool.end()) ? 0 : reinterpret_cast<sal_uIntPtr>(it->pData);
} }
StringPool::StrIdType StringPool::getIdentifierIgnoreCase( const OUString& rStr ) const sal_uIntPtr StringPool::getIdentifierIgnoreCase( const OUString& rStr ) const
{ {
StrHashType::const_iterator itOrig = maStrPool.find(rStr); StrHashType::const_iterator itOrig = maStrPool.find(rStr);
if (itOrig == maStrPool.end()) if (itOrig == maStrPool.end())
...@@ -64,7 +64,7 @@ StringPool::StrIdType StringPool::getIdentifierIgnoreCase( const OUString& rStr ...@@ -64,7 +64,7 @@ StringPool::StrIdType StringPool::getIdentifierIgnoreCase( const OUString& rStr
return 0; return 0;
const rtl_uString* pUpper = itUpper->second.pData; const rtl_uString* pUpper = itUpper->second.pData;
return reinterpret_cast<StrIdType>(pUpper); return reinterpret_cast<sal_uIntPtr>(pUpper);
} }
namespace { namespace {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment