summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-10-08 15:18:16 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-08 15:48:12 -0400
commit3786609a153b7fa38393eb646557d241af2d3060 (patch)
treed2d33086cf318229a7893dc0958630834fc1ec16 /svl
parenta7ff6e0a3fc5fccad33f06ae9d4ec7019f9ae156 (diff)
No more getIdentifier*() calls because they are not efficient.
They shall never be used. Change-Id: I019c88b1511a67175d782777cd41e0ec0434f497
Diffstat (limited to 'svl')
-rw-r--r--svl/source/misc/sharedstring.cxx10
-rw-r--r--svl/source/misc/sharedstringpool.cxx22
2 files changed, 10 insertions, 22 deletions
diff --git a/svl/source/misc/sharedstring.cxx b/svl/source/misc/sharedstring.cxx
index e8ad0b7d4fd4..5eb3af5cbbf4 100644
--- a/svl/source/misc/sharedstring.cxx
+++ b/svl/source/misc/sharedstring.cxx
@@ -78,6 +78,11 @@ bool SharedString::operator== ( const SharedString& r ) const
return !r.mpData;
}
+bool SharedString::operator!= ( const SharedString& r ) const
+{
+ return !operator== (r);
+}
+
OUString SharedString::getString() const
{
return mpData ? OUString(mpData) : OUString();
@@ -103,6 +108,11 @@ const rtl_uString* SharedString::getDataIgnoreCase() const
return mpDataIgnoreCase;
}
+bool SharedString::isValid() const
+{
+ return mpData != NULL;
+}
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svl/source/misc/sharedstringpool.cxx b/svl/source/misc/sharedstringpool.cxx
index 6b8f15287aca..46bf814f8468 100644
--- a/svl/source/misc/sharedstringpool.cxx
+++ b/svl/source/misc/sharedstringpool.cxx
@@ -52,28 +52,6 @@ SharedString SharedStringPool::intern( const OUString& rStr )
return SharedString(pOrig, aRes.first->pData);
}
-sal_uIntPtr SharedStringPool::getIdentifier( const OUString& rStr ) const
-{
- StrHashType::const_iterator it = maStrPool.find(rStr);
- return (it == maStrPool.end()) ? 0 : reinterpret_cast<sal_uIntPtr>(it->pData);
-}
-
-sal_uIntPtr SharedStringPool::getIdentifierIgnoreCase( const OUString& rStr ) const
-{
- StrHashType::const_iterator itOrig = maStrPool.find(rStr);
- if (itOrig == maStrPool.end())
- // Not in the pool.
- return 0;
-
- StrStoreType::const_iterator itUpper = maStrStore.find(itOrig->pData);
- if (itUpper == maStrStore.end())
- // Passed string is not in the pool.
- return 0;
-
- const rtl_uString* pUpper = itUpper->second.pData;
- return reinterpret_cast<sal_uIntPtr>(pUpper);
-}
-
namespace {
inline sal_Int32 getRefCount( const rtl_uString* p )