diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-01 17:42:34 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-02 13:31:19 +0200 |
commit | 1927b51993fb68907a75765676179b08ab195196 (patch) | |
tree | 1b7d09c1b5e7ea945fb6ea618a4c100e8630ebb4 /sc/source/ui | |
parent | 0dfa444f393a5766d36fe7d2480d0c8ec832e329 (diff) |
loplugin:stringviewparam convert methods using indexOf
.. and lastIndexOf, which convert to find and rfind
Change-Id: I6c4156cf904774c0d867f85a4c2785dba7593f62
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132445
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/exceldetect.cxx | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 4d5d1a1d8ac2..abd1190475fb 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1107,9 +1107,9 @@ void ScInputHandler::HideTipBelow() namespace { -bool lcl_hasSingleToken(const OUString& s, sal_Unicode c) +bool lcl_hasSingleToken(std::u16string_view s, sal_Unicode c) { - return !s.isEmpty() && s.indexOf(c)<0; + return !s.empty() && s.find(c) == std::u16string_view::npos; } } diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 8c64e3a8416f..633fda283499 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -3422,7 +3422,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportDBF(SvStream &rStream) OUString sTmpDir = aTmpDir.GetURL(); OUString sExtension(".dbf"); - utl::TempFile aTempInput(OUString(), true, &sExtension, &sTmpDir); + utl::TempFile aTempInput(u"", true, &sExtension, &sTmpDir); aTempInput.EnableKillingFile(); SvStream* pInputStream = aTempInput.GetStream(StreamMode::WRITE); diff --git a/sc/source/ui/unoobj/exceldetect.cxx b/sc/source/ui/unoobj/exceldetect.cxx index a50f9994f4d2..75694bbc9620 100644 --- a/sc/source/ui/unoobj/exceldetect.cxx +++ b/sc/source/ui/unoobj/exceldetect.cxx @@ -120,9 +120,9 @@ bool isExcel40(const uno::Reference<io::XInputStream>& xInStream) return true; } -bool isTemplate(const OUString& rType) +bool isTemplate(std::u16string_view rType) { - return rType.indexOf("_VorlageTemplate") != -1; + return rType.find(u"_VorlageTemplate") != std::u16string_view::npos; } } |