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 /sd/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 'sd/source/ui')
-rw-r--r-- | sd/source/ui/dlg/TemplateScanner.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sd/source/ui/dlg/TemplateScanner.cxx b/sd/source/ui/dlg/TemplateScanner.cxx index 04f5e8261e90..afd23ff855ee 100644 --- a/sd/source/ui/dlg/TemplateScanner.cxx +++ b/sd/source/ui/dlg/TemplateScanner.cxx @@ -65,25 +65,25 @@ public: /** Use a heuristic based on the URL of a top-level template folder to assign a priority that is used to sort the folders. */ -int Classify (const OUString& rsURL) +int Classify (std::u16string_view rsURL) { int nPriority (0); - if (rsURL.isEmpty()) + if (rsURL.empty()) nPriority = 100; - else if (rsURL.indexOf("presnt")>=0) + else if (rsURL.find(u"presnt") != std::u16string_view::npos) { nPriority = 30; } - else if (rsURL.indexOf("layout")>=0) + else if (rsURL.find(u"layout") != std::u16string_view::npos) { nPriority = 20; } - else if (rsURL.indexOf("educate")>=0) + else if (rsURL.find(u"educate") != std::u16string_view::npos) { nPriority = 40; } - else if (rsURL.indexOf("finance")>=0) + else if (rsURL.find(u"finance") != std::u16string_view::npos) { nPriority = 40; } |