summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-06 16:35:26 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-07 09:52:26 +0200
commitffdd06c2237f7dd935581e43c08d079b6a4337cd (patch)
tree3cb4cd39dce525b344086c5609656e2d81a7f44c
parent59f5f666a5085ae58a8dd164636a6bea47e6bddc (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>
-rw-r--r--include/svl/sharedstringpool.hxx2
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx2
-rw-r--r--sc/source/core/data/documen2.cxx2
-rw-r--r--svl/qa/unit/svl.cxx4
-rw-r--r--svl/source/misc/sharedstringpool.cxx14
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());