diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-12 12:43:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-04-13 08:38:53 +0200 |
commit | fdfd517a6f75e394ddcb1e195decbfed33ba56b9 (patch) | |
tree | e3bff14e5531affcd908415b4e85d7ceac4aa1fd /vcl/workben | |
parent | e568c9dca8b93b96a8a130a8fb6f1bba1a33d6ea (diff) |
loplugin:stringviewparam whitelist some more functions
for which we have o3tl:: equivalents
Change-Id: I4670fd8b703ac47214be213f41e88d1c6ede7032
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132913
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/workben')
-rw-r--r-- | vcl/workben/svpclient.cxx | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx index 07153f100016..584ad041d62a 100644 --- a/vcl/workben/svpclient.cxx +++ b/vcl/workben/svpclient.cxx @@ -41,6 +41,7 @@ #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> +#include <o3tl/string_view.hxx> #include <math.h> @@ -106,7 +107,7 @@ public: virtual ~MyWin() override { disposeOnce(); } virtual void dispose() override; - void parseList( const OString& rList ); + void parseList( std::string_view rList ); static OString processCommand( const OString& rCommand ); DECL_LINK( ListHdl, Button*, void ); @@ -167,19 +168,19 @@ void MyWin::dispose() WorkWindow::dispose(); } -void MyWin::parseList( const OString& rList ) +void MyWin::parseList( std::string_view rList ) { sal_Int32 nTokenPos = 0; OUString aElementType; m_aSvpBitmaps->Clear(); while( nTokenPos >= 0 ) { - OString aLine = rList.getToken( 0, '\n', nTokenPos ); - if( ! aLine.getLength() || *aLine.getStr() == '#' ) + std::string_view aLine = o3tl::getToken(rList, 0, '\n', nTokenPos ); + if( aLine.empty() || aLine[0] == '#' ) continue; - if( aLine.startsWith( "ElementType: " ) ) - aElementType = OStringToOUString( aLine.subView( 13 ), RTL_TEXTENCODING_ASCII_US ); + if( o3tl::starts_with(aLine, "ElementType: " ) ) + aElementType = OStringToOUString( aLine.substr( 13 ), RTL_TEXTENCODING_ASCII_US ); else { OUString aNewElement = |