diff options
-rw-r--r-- | include/svl/sharedstringpool.hxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/misc/UITools.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/documen2.cxx | 2 | ||||
-rw-r--r-- | svl/qa/unit/svl.cxx | 4 | ||||
-rw-r--r-- | svl/source/misc/sharedstringpool.cxx | 14 |
5 files changed, 10 insertions, 14 deletions
diff --git a/include/svl/sharedstringpool.hxx b/include/svl/sharedstringpool.hxx index 88adc1b48b79..a2cae3a9a08c 100644 --- a/include/svl/sharedstringpool.hxx +++ b/include/svl/sharedstringpool.hxx @@ -34,7 +34,7 @@ class SVL_DLLPUBLIC SharedStringPool SharedStringPool& operator=( const SharedStringPool& ) = delete; public: - SharedStringPool( const CharClass* pCharClass ); + SharedStringPool( const CharClass& rCharClass ); ~SharedStringPool(); /** diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 42c172c2b818..f2ac0ebaf328 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -1023,7 +1023,7 @@ bool openDialogFormula_nothrow( OUString& _in_out_rFormula LanguageTag aLangTag(LANGUAGE_SYSTEM); CharClass aCC(_xContext, aLangTag); - svl::SharedStringPool aStringPool(&aCC); + svl::SharedStringPool aStringPool(aCC); ScopedVclPtrInstance<FormulaDialog> aDlg( pParent, xServiceFactory, pFormulaManager, diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index caf2df997831..46bff72a4a10 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -134,7 +134,7 @@ private: }; ScDocument::ScDocument( ScDocumentMode eMode, SfxObjectShell* pDocShell ) : - mpCellStringPool(new svl::SharedStringPool(ScGlobal::pCharClass)), + mpCellStringPool(new svl::SharedStringPool(*ScGlobal::pCharClass)), mpDocLinkMgr(new sc::DocumentLinkManager(pDocShell)), mpFormulaGroupCxt(nullptr), mbFormulaGroupCxtBlockDiscard(false), diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index 69c1be6f853f..ec65d2962ccf 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -311,7 +311,7 @@ void Test::testSharedString() void Test::testSharedStringPool() { SvtSysLocale aSysLocale; - svl::SharedStringPool aPool(aSysLocale.GetCharClassPtr()); + svl::SharedStringPool aPool(*aSysLocale.GetCharClassPtr()); svl::SharedString p1, p2; p1 = aPool.intern("Andy"); @@ -344,7 +344,7 @@ void Test::testSharedStringPool() void Test::testSharedStringPoolPurge() { SvtSysLocale aSysLocale; - svl::SharedStringPool aPool(aSysLocale.GetCharClassPtr()); + svl::SharedStringPool aPool(*aSysLocale.GetCharClassPtr()); aPool.intern("Andy"); aPool.intern("andy"); aPool.intern("ANDY"); 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()); |