summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-10-02 14:06:13 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-04 19:15:22 -0400
commit46ca6ab1fe69a29b75c3b9c3a04af27b5af63fd3 (patch)
treefb4b4b41ced116739af004a80ed6f33e60670832
parent2c96a2887360f3b152b369a745440d4b503aa70d (diff)
The map actualy needs to store OUString to have it ref-counted automatically.
Change-Id: Iff6fcf3aba73f2d06ac0c885b39e69ac0febc49f
-rw-r--r--include/svl/stringpool.hxx2
-rw-r--r--svl/source/misc/stringpool.cxx5
2 files changed, 3 insertions, 4 deletions
diff --git a/include/svl/stringpool.hxx b/include/svl/stringpool.hxx
index 4436efeb2d81..d2eca12e9609 100644
--- a/include/svl/stringpool.hxx
+++ b/include/svl/stringpool.hxx
@@ -29,7 +29,7 @@ class SVL_DLLPUBLIC StringPool
{
typedef boost::unordered_set<OUString, OUStringHash> StrHashType;
typedef std::pair<StrHashType::iterator, bool> InsertResultType;
- typedef boost::unordered_map<const rtl_uString*, const rtl_uString*> StrIdMapType;
+ typedef boost::unordered_map<const rtl_uString*, OUString> StrIdMapType;
StrHashType maStrPool;
StrHashType maStrPoolUpper;
diff --git a/svl/source/misc/stringpool.cxx b/svl/source/misc/stringpool.cxx
index 76dc4aaf34e2..11b62881b95b 100644
--- a/svl/source/misc/stringpool.cxx
+++ b/svl/source/misc/stringpool.cxx
@@ -40,8 +40,7 @@ rtl_uString* StringPool::intern( const OUString& rStr )
return pOrig;
// Set mapping.
- rtl_uString* pUpper = aRes.first->pData;
- maToUpperMap.insert(StrIdMapType::value_type(pOrig, pUpper));
+ maToUpperMap.insert(StrIdMapType::value_type(pOrig, *aRes.first));
return pOrig;
}
@@ -64,7 +63,7 @@ StringPool::StrIdType StringPool::getIdentifierIgnoreCase( const OUString& rStr
// Passed string is not in the pool.
return 0;
- const rtl_uString* pUpper = itUpper->second;
+ const rtl_uString* pUpper = itUpper->second.pData;
return reinterpret_cast<StrIdType>(pUpper);
}