diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-09-22 20:02:06 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-09-22 22:19:07 +0200 |
commit | 0a4c883a7e0dd3ba66d8cc86c6f77bd3578a0a92 (patch) | |
tree | 5816d867c3ec4bdd32f65180eb59931487156c85 | |
parent | 51c9d41ca97955dd986cd5fec1aed6fbc6ec1374 (diff) |
Extend loplugin:stringviewparam to starts/endsWith: sd
Change-Id: Ie7ddfbc7984bfbff22c8c34e30f3ca690da80e7b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122483
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | sd/source/core/stlsheet.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 533a9846557f..d0ea45f4c640 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -25,6 +25,7 @@ #include <com/sun/star/table/BorderLine.hpp> #include <com/sun/star/text/XTextColumns.hpp> +#include <o3tl/string_view.hxx> #include <osl/mutex.hxx> #include <vcl/svapp.hxx> #include <cppuhelper/exc_hlp.hxx> @@ -627,14 +628,14 @@ OUString GetApiNameForHelpId(sal_uLong nId) return OUString(); } -sal_uInt32 GetHelpIdForApiName(const OUString& sName) +sal_uInt32 GetHelpIdForApiName(std::u16string_view sName) { - OUString sRest; - if (sName.startsWith("outline", &sRest)) + std::u16string_view sRest; + if (o3tl::starts_with(sName, u"outline", &sRest)) { - if (sRest.getLength() == 1) + if (sRest.length() == 1) { - sal_Unicode ch = sRest.toChar(); + sal_Unicode ch = sRest.front(); if ('1' <= ch && ch <= '9') return HID_PSEUDOSHEET_OUTLINE1 + ch - '1'; } |