sd/source/core/stlsheet.cxx |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 0a4c883a7e0dd3ba66d8cc86c6f77bd3578a0a92
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Wed Sep 22 20:02:06 2021 +0200
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Wed Sep 22 22:19:07 2021 +0200

    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 <sberg...@redhat.com>

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';
         }

Reply via email to