summaryrefslogtreecommitdiff
path: root/sc/source/ui/app
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-10-06 08:57:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-10-06 13:03:03 +0200
commitce6babf777882d78dbf322de74f321354ac7b351 (patch)
treed016b73b5622d36c1dfbbd3f2f15ace42c9ac507 /sc/source/ui/app
parent3c7cbaf19a5108e3870df6556c16ef25710011a2 (diff)
use more string_view in sc
Change-Id: Ic7126ac57f8cc06b37f3098603f0710602f0ab28 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140998 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/app')
-rw-r--r--sc/source/ui/app/inputhdl.cxx18
-rw-r--r--sc/source/ui/app/scmod.cxx4
2 files changed, 11 insertions, 11 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index ecca9785185c..0d8274e3cc59 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -159,7 +159,7 @@ OUString getExactMatch(const ScTypedCaseStrSet& rDataSet, const OUString& rStrin
// This assumes that rResults is a sorted ring w.r.t ScTypedStrData::LessCaseInsensitive() or
// in the reverse direction, whose origin is specified by nRingOrigin.
-sal_Int32 getLongestCommonPrefixLength(const std::vector<OUString>& rResults, const OUString& rUserEntry, sal_Int32 nRingOrigin)
+sal_Int32 getLongestCommonPrefixLength(const std::vector<OUString>& rResults, std::u16string_view aUserEntry, sal_Int32 nRingOrigin)
{
sal_Int32 nResults = rResults.size();
if (!nResults)
@@ -168,7 +168,7 @@ sal_Int32 getLongestCommonPrefixLength(const std::vector<OUString>& rResults, co
if (nResults == 1)
return rResults[0].getLength();
- sal_Int32 nMinLen = rUserEntry.getLength();
+ sal_Int32 nMinLen = aUserEntry.size();
sal_Int32 nLastIdx = nRingOrigin ? nRingOrigin - 1 : nResults - 1;
const OUString& rFirst = rResults[nRingOrigin];
const OUString& rLast = rResults[nLastIdx];
@@ -3005,12 +3005,12 @@ void ScInputHandler::SetMode( ScInputMode eNewMode, const OUString* pInitText, S
/**
* @return true if rString only contains digits (no autocorrect then)
*/
-static bool lcl_IsNumber(const OUString& rString)
+static bool lcl_IsNumber(std::u16string_view aString)
{
- sal_Int32 nLen = rString.getLength();
- for (sal_Int32 i=0; i<nLen; i++)
+ size_t nLen = aString.size();
+ for (size_t i=0; i<nLen; i++)
{
- sal_Unicode c = rString[i];
+ sal_Unicode c = aString[i];
if ( c < '0' || c > '9' )
return false;
}
@@ -4551,7 +4551,7 @@ void ScInputHandler::InputSetSelection( sal_Int32 nStart, sal_Int32 nEnd )
bModified = true;
}
-void ScInputHandler::InputReplaceSelection( const OUString& rStr )
+void ScInputHandler::InputReplaceSelection( std::u16string_view aStr )
{
if (!pRefViewSh)
pRefViewSh = pActiveViewSh;
@@ -4559,13 +4559,13 @@ void ScInputHandler::InputReplaceSelection( const OUString& rStr )
OSL_ENSURE(nFormSelEnd>=nFormSelStart,"Selection broken...");
sal_Int32 nOldLen = nFormSelEnd - nFormSelStart;
- sal_Int32 nNewLen = rStr.getLength();
+ sal_Int32 nNewLen = aStr.size();
OUStringBuffer aBuf(aFormText);
if (nOldLen)
aBuf.remove(nFormSelStart, nOldLen);
if (nNewLen)
- aBuf.insert(nFormSelStart, rStr);
+ aBuf.insert(nFormSelStart, aStr);
aFormText = aBuf.makeStringAndClear();
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index e777e1b5d325..18aa0845088c 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -1462,11 +1462,11 @@ void ScModule::InputSetSelection( sal_Int32 nStart, sal_Int32 nEnd )
pHdl->InputSetSelection( nStart, nEnd );
}
-void ScModule::InputReplaceSelection( const OUString& rStr )
+void ScModule::InputReplaceSelection( std::u16string_view aStr )
{
ScInputHandler* pHdl = GetInputHdl();
if (pHdl)
- pHdl->InputReplaceSelection( rStr );
+ pHdl->InputReplaceSelection( aStr );
}
void ScModule::InputTurnOffWinEngine()