From 8d65f68f98950efe7cb117d7ad228bab79ad0ddb Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 22 Sep 2021 17:15:46 +0200 Subject: Extend loplugin:stringviewparam to starts/endsWith: unotools Change-Id: Ie8c73d187045d9def8f462ab7d37830331eabd4d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122470 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- unotools/source/config/dynamicmenuoptions.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'unotools') diff --git a/unotools/source/config/dynamicmenuoptions.cxx b/unotools/source/config/dynamicmenuoptions.cxx index 14ce7bb87aa5..38138797f149 100644 --- a/unotools/source/config/dynamicmenuoptions.cxx +++ b/unotools/source/config/dynamicmenuoptions.cxx @@ -19,6 +19,7 @@ #include +#include #include #include #include @@ -30,6 +31,7 @@ #include #include +#include using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -51,7 +53,7 @@ constexpr OUStringLiteral SETNODE_WIZARDMENU = u"Wizard"; #define PROPERTYCOUNT 4 -constexpr OUStringLiteral PATHPREFIX_SETUP = u"m"; +constexpr std::u16string_view PATHPREFIX_SETUP = u"m"; namespace { @@ -300,10 +302,10 @@ static void lcl_SortAndExpandPropertyNames( const Sequence< OUString >& lSource }; struct SelectByPrefix { - bool operator() ( const OUString& s ) const + bool operator() ( std::u16string_view s ) const { // Prefer setup written entries by check first letter of given string. It must be a "s". - return s.startsWith( PATHPREFIX_SETUP ); + return o3tl::starts_with( s, PATHPREFIX_SETUP ); } }; -- cgit