summaryrefslogtreecommitdiff
path: root/scripting/source/provider
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-03 10:34:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-17 10:27:33 +0200
commit33bd16b344e273c427091ee68e946bf67b371dd7 (patch)
tree85fb383ea8e3d30f393bb197b5c74f73f6ca247f /scripting/source/provider
parentfe597a337914decd62480d3eba84258333116db9 (diff)
loplugin:stringviewparam convert methods using copy()
which converts to std::string_view::substr() Change-Id: I3f42213b41a97e77ddcc79d84d512f49d68ca559 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132729 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'scripting/source/provider')
-rw-r--r--scripting/source/provider/URIHelper.cxx8
-rw-r--r--scripting/source/provider/URIHelper.hxx2
2 files changed, 5 insertions, 5 deletions
diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx
index 481a5b2f6e4e..5333bee34da4 100644
--- a/scripting/source/provider/URIHelper.cxx
+++ b/scripting/source/provider/URIHelper.cxx
@@ -164,16 +164,16 @@ ScriptingFrameworkURIHelper::initBaseURI()
}
OUString
-ScriptingFrameworkURIHelper::getLanguagePart(const OUString& rStorageURI)
+ScriptingFrameworkURIHelper::getLanguagePart(std::u16string_view rStorageURI)
{
OUString result;
- sal_Int32 idx = rStorageURI.indexOf(m_sBaseURI);
+ size_t idx = rStorageURI.find(m_sBaseURI);
sal_Int32 len = m_sBaseURI.getLength() + 1;
- if ( idx != -1 )
+ if ( idx != std::u16string_view::npos )
{
- result = rStorageURI.copy(idx + len);
+ result = rStorageURI.substr(idx + len);
result = result.replace('/', '|');
}
return result;
diff --git a/scripting/source/provider/URIHelper.hxx b/scripting/source/provider/URIHelper.hxx
index e7a05fd73d99..9d200a1a377f 100644
--- a/scripting/source/provider/URIHelper.hxx
+++ b/scripting/source/provider/URIHelper.hxx
@@ -50,7 +50,7 @@ private:
OUString SCRIPTS_PART;
bool initBaseURI();
- OUString getLanguagePart(const OUString& rStorageURI);
+ OUString getLanguagePart(std::u16string_view rStorageURI);
static OUString getLanguagePath(const OUString& rLanguagePart);
public: