[Libreoffice-commits] core.git: cpputools/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 23 08:16:09 UTC 2021


 cpputools/source/unoexe/unoexe.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 77b23d1b5979ce65058f845f73cb48894ba68325
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Sep 23 07:31:09 2021 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Sep 23 10:15:31 2021 +0200

    Extend loplugin:stringviewparam to starts/endsWith: cpputools
    
    Change-Id: I016ca2ecf63d62d7799db1098ba0455e337aa3eb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122507
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/cpputools/source/unoexe/unoexe.cxx b/cpputools/source/unoexe/unoexe.cxx
index 2181e850d7fe..34be8e964ca8 100644
--- a/cpputools/source/unoexe/unoexe.cxx
+++ b/cpputools/source/unoexe/unoexe.cxx
@@ -22,6 +22,7 @@
 
 #include <sal/main.h>
 #include <sal/log.hxx>
+#include <o3tl/string_view.hxx>
 #include <osl/diagnose.h>
 #include <osl/mutex.hxx>
 #include <osl/conditn.hxx>
@@ -126,11 +127,11 @@ static bool readOption( OUString * pValue, const char * pOpt,
 }
 
 static bool readOption( bool * pbOpt, const char * pOpt,
-                        sal_uInt32 * pnIndex, const OUString & aArg)
+                        sal_uInt32 * pnIndex, std::u16string_view aArg)
 {
     OUString aOpt = OUString::createFromAscii(pOpt);
 
-    if(aArg.startsWith("--") && aOpt == aArg.subView(2))
+    if(o3tl::starts_with(aArg, u"--") && aOpt == aArg.substr(2))
     {
         ++(*pnIndex);
         *pbOpt = true;


More information about the Libreoffice-commits mailing list