summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-09-22 17:15:46 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-09-22 18:54:52 +0200
commit8d65f68f98950efe7cb117d7ad228bab79ad0ddb (patch)
tree5a6223ecb5f81bd172a91d274b83a3402affd294 /unotools
parent805cc60039fcce2ba356430cb90811a6e300a540 (diff)
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 <sbergman@redhat.com>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/dynamicmenuoptions.cxx8
1 files changed, 5 insertions, 3 deletions
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 <sal/config.h>
+#include <o3tl/string_view.hxx>
#include <sal/log.hxx>
#include <unotools/dynamicmenuoptions.hxx>
#include <tools/debug.hxx>
@@ -30,6 +31,7 @@
#include <vector>
#include <algorithm>
+#include <string_view>
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 );
}
};