diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-11 22:24:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-12 12:42:15 +0200 |
commit | cbaf1fbaa6e707d939f815eda360fad68a492aca (patch) | |
tree | 20b3dfeac257130afb01572b2c117b7840d07007 /xmlhelp/source/cxxhelp | |
parent | f751417b77e6573a0c639778e76ec943449f4573 (diff) |
loplugin:stringview more o3tl conversion
look for call sequences that can use string_view and the new o3tl
functions in o3tl/string_view.hxx
Also add a few more wrappers to said #include file
Change-Id: I05d8752cc67a7b55b0b57e8eed803bd06bfcd9ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132840
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlhelp/source/cxxhelp')
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index 9393692b7656..5eb9e6420b00 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -27,6 +27,7 @@ #include <rtl/uri.hxx> #include <rtl/ref.hxx> #include <rtl/character.hxx> +#include <o3tl/string_view.hxx> #include <libxslt/transform.h> #include <libxslt/xsltutils.h> #include <libxslt/security.h> @@ -452,7 +453,7 @@ bool URLParameter::query() if( m_aExpr.isEmpty() ) return true; else if( m_aExpr[0] == '?' ) - query_ = m_aExpr.copy( 1 ).trim(); + query_ = o3tl::trim(m_aExpr.subView( 1 )); else return false; @@ -465,16 +466,16 @@ bool URLParameter::query() { delimIdx = query_.indexOf( '&' ); equalIdx = query_.indexOf( '=' ); - parameter = query_.copy( 0,equalIdx ).trim(); + parameter = o3tl::trim(query_.subView( 0,equalIdx )); if( delimIdx == -1 ) { - value = query_.copy( equalIdx + 1 ).trim(); + value = o3tl::trim(query_.subView( equalIdx + 1 )); query_.clear(); } else { - value = query_.copy( equalIdx+1,delimIdx - equalIdx - 1 ).trim(); - query_ = query_.copy( delimIdx+1 ).trim(); + value = o3tl::trim(query_.subView( equalIdx+1,delimIdx - equalIdx - 1 )); + query_ = o3tl::trim(query_.subView( delimIdx+1 )); } if( parameter == "Language" ) |