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 /configmgr/source | |
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 'configmgr/source')
-rw-r--r-- | configmgr/source/data.cxx | 8 | ||||
-rw-r--r-- | configmgr/source/data.hxx | 2 | ||||
-rw-r--r-- | configmgr/source/xmldata.cxx | 4 | ||||
-rw-r--r-- | configmgr/source/xmldata.hxx | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/configmgr/source/data.cxx b/configmgr/source/data.cxx index 6e95f1665726..6279e02cf096 100644 --- a/configmgr/source/data.cxx +++ b/configmgr/source/data.cxx @@ -148,14 +148,14 @@ sal_Int32 Data::parseSegment( } OUString Data::fullTemplateName( - OUString const & component, OUString const & name) + std::u16string_view component, std::u16string_view name) { - if (component.indexOf(':') != -1 || name.indexOf(':') != -1) { + if (component.find(':') != std::u16string_view::npos || name.find(':') != std::u16string_view::npos) { throw css::uno::RuntimeException( - "bad component/name pair containing colon " + component + "/" + + OUString::Concat("bad component/name pair containing colon ") + component + "/" + name); } - return component + ":" + name; + return OUString::Concat(component) + ":" + name; } bool Data::equalTemplateNames( diff --git a/configmgr/source/data.hxx b/configmgr/source/data.hxx index 9e1da0829679..c3614e6435da 100644 --- a/configmgr/source/data.hxx +++ b/configmgr/source/data.hxx @@ -58,7 +58,7 @@ struct Data { bool * setElement, OUString * templateName); static OUString fullTemplateName( - OUString const & component, OUString const & name); + std::u16string_view component, std::u16string_view name); //TODO: better rules under which circumstances a short template name matches static bool equalTemplateNames( diff --git a/configmgr/source/xmldata.cxx b/configmgr/source/xmldata.cxx index a2a05877674e..ecb4dacab41f 100644 --- a/configmgr/source/xmldata.cxx +++ b/configmgr/source/xmldata.cxx @@ -115,8 +115,8 @@ bool parseBoolean(xmlreader::Span const & text) { } OUString parseTemplateReference( - OUString const & component, bool hasNodeType, - OUString const & nodeType, OUString const * defaultTemplateName) + std::u16string_view component, bool hasNodeType, + std::u16string_view nodeType, OUString const * defaultTemplateName) { if (!hasNodeType) { if (defaultTemplateName != nullptr) { diff --git a/configmgr/source/xmldata.hxx b/configmgr/source/xmldata.hxx index c72050af84ce..44296b38d58d 100644 --- a/configmgr/source/xmldata.hxx +++ b/configmgr/source/xmldata.hxx @@ -38,8 +38,8 @@ Type parseType( bool parseBoolean(xmlreader::Span const & text); OUString parseTemplateReference( - OUString const & component, bool hasNodeType, - OUString const & nodeType, OUString const * defaultTemplateName); + std::u16string_view component, bool hasNodeType, + std::u16string_view nodeType, OUString const * defaultTemplateName); } |