summaryrefslogtreecommitdiff
path: root/sc/source/core/tool/interpr1.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-09-17 10:59:51 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-17 15:02:55 +0200
commitce707fc2d3420be9423bb5e8d0300dbb71a5db6e (patch)
tree314ae040d0c8033fbd1a251b3bdc5b7db9529456 /sc/source/core/tool/interpr1.cxx
parentc67b9a4ce5ac3a09437730d8440c84159b581622 (diff)
rather return ref from GetCollator
since we never return a nullptr. Also add a new utility method to simplify the call sites that need to pick the right collator Change-Id: I5deb009cb5144fd182bbc6470ae30ea05e6979c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122237 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/core/tool/interpr1.cxx')
-rw-r--r--sc/source/core/tool/interpr1.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 8d2d81fe850a..5923116be0d2 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -4722,7 +4722,7 @@ sal_Int32 lcl_CompareMatrix2Query(
OUString aStr1 = rMat.GetString(i);
OUString aStr2 = rEntry.GetQueryItem().maString.getString();
- return ScGlobal::GetCollator()->compareString(aStr1, aStr2); // case-insensitive
+ return ScGlobal::GetCollator().compareString(aStr1, aStr2); // case-insensitive
}
/** returns the last item with the identical value as the original item
@@ -6720,7 +6720,7 @@ void ScInterpreter::ScLookup()
if (rItem.meType != ScQueryEntry::ByString)
bFound = false;
else
- bFound = (ScGlobal::GetCollator()->compareString(aDataStr.getString(), rItem.maString.getString()) <= 0);
+ bFound = (ScGlobal::GetCollator().compareString(aDataStr.getString(), rItem.maString.getString()) <= 0);
}
if (!bFound)
@@ -7306,13 +7306,13 @@ void ScInterpreter::CalculateLookup(bool bHLookup)
svl::SharedString aParamStr = rItem.maString;
if ( bSorted )
{
- CollatorWrapper* pCollator = ScGlobal::GetCollator();
+ CollatorWrapper& rCollator = ScGlobal::GetCollator();
for (SCSIZE i = 0; i < nMatCount; i++)
{
if (bHLookup ? pMat->IsStringOrEmpty(i, 0) : pMat->IsStringOrEmpty(0, i))
{
sal_Int32 nRes =
- pCollator->compareString(
+ rCollator.compareString(
bHLookup ? pMat->GetString(i,0).getString() : pMat->GetString(0,i).getString(), aParamStr.getString());
if (nRes <= 0)
nDelta = i;