diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-06 16:35:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-07 09:52:26 +0200 |
commit | ffdd06c2237f7dd935581e43c08d079b6a4337cd (patch) | |
tree | 3cb4cd39dce525b344086c5609656e2d81a7f44c /svl/source/misc/sharedstringpool.cxx | |
parent | 59f5f666a5085ae58a8dd164636a6bea47e6bddc (diff) |
SharedStringPool is always called with a CharClass
Change-Id: Ib2b9963a90a135998b6189fba521bd85f5579cf5
Reviewed-on: https://gerrit.libreoffice.org/58645
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl/source/misc/sharedstringpool.cxx')
-rw-r--r-- | svl/source/misc/sharedstringpool.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/svl/source/misc/sharedstringpool.cxx b/svl/source/misc/sharedstringpool.cxx index 64993497957b..af1d80ef65d0 100644 --- a/svl/source/misc/sharedstringpool.cxx +++ b/svl/source/misc/sharedstringpool.cxx @@ -52,13 +52,13 @@ struct SharedStringPool::Impl StrHashType maStrPool; StrHashType maStrPoolUpper; StrStoreType maStrStore; - const CharClass* mpCharClass; + const CharClass& mrCharClass; - explicit Impl( const CharClass* pCharClass ) : mpCharClass(pCharClass) {} + explicit Impl( const CharClass& rCharClass ) : mrCharClass(rCharClass) {} }; -SharedStringPool::SharedStringPool( const CharClass* pCharClass ) : - mpImpl(new Impl(pCharClass)) {} +SharedStringPool::SharedStringPool( const CharClass& rCharClass ) : + mpImpl(new Impl(rCharClass)) {} SharedStringPool::~SharedStringPool() { @@ -72,10 +72,6 @@ SharedString SharedStringPool::intern( const OUString& rStr ) rtl_uString* pOrig = aRes.first->pData; - if (!mpImpl->mpCharClass) - // We don't track case insensitive strings. - return SharedString(pOrig, nullptr); - if (!aRes.second) { // No new string has been inserted. Return the existing string in the pool. @@ -88,7 +84,7 @@ SharedString SharedStringPool::intern( const OUString& rStr ) // This is a new string insertion. Establish mapping to upper-case variant. - OUString aUpper = mpImpl->mpCharClass->uppercase(rStr); + OUString aUpper = mpImpl->mrCharClass.uppercase(rStr); aRes = findOrInsert(mpImpl->maStrPoolUpper, aUpper); assert(aRes.first != mpImpl->maStrPoolUpper.end()); |