ucbhelper/source/client/proxydecider.cxx |   19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

New commits:
commit d9c3f05dcb6c03633bbcc8d88e55237a0855d9a5
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Apr 27 20:42:35 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Apr 28 20:56:18 2022 +0200

    use more string_view in ucbhelper
    
    Change-Id: Ief60eda8be8e184b9d637ab84fec2f8740c04396
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133554
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/ucbhelper/source/client/proxydecider.cxx 
b/ucbhelper/source/client/proxydecider.cxx
index 10228b72aedc..cf10fda8baa3 100644
--- a/ucbhelper/source/client/proxydecider.cxx
+++ b/ucbhelper/source/client/proxydecider.cxx
@@ -157,7 +157,7 @@ public:
     virtual void SAL_CALL disposing( const lang::EventObject& Source ) 
override;
 
 private:
-    void setNoProxyList( const OUString & rNoProxyList );
+    void setNoProxyList( std::u16string_view rNoProxyList );
 };
 
 
@@ -809,29 +809,28 @@ void SAL_CALL InternetProxyDecider_Impl::disposing(const 
lang::EventObject&)
 }
 
 
-void InternetProxyDecider_Impl::setNoProxyList(
-                                        const OUString & rNoProxyList )
+void InternetProxyDecider_Impl::setNoProxyList( std::u16string_view 
rNoProxyList )
 {
     osl::Guard< osl::Mutex > aGuard( m_aMutex );
 
     m_aNoProxyList.clear();
 
-    if ( rNoProxyList.isEmpty() )
+    if ( rNoProxyList.empty() )
         return;
 
     // List of connection endpoints hostname[:port],
     // separated by semicolon. Wildcards allowed.
 
-    sal_Int32 nPos = 0;
-    sal_Int32 nEnd = rNoProxyList.indexOf( ';' );
-    sal_Int32 nLen = rNoProxyList.getLength();
+    size_t nPos = 0;
+    size_t nEnd = rNoProxyList.find( ';' );
+    size_t nLen = rNoProxyList.size();
 
     do
     {
-        if ( nEnd == -1 )
+        if ( nEnd == std::u16string_view::npos )
             nEnd = nLen;
 
-        OUString aToken = rNoProxyList.copy( nPos, nEnd - nPos );
+        OUString aToken( rNoProxyList.substr( nPos, nEnd - nPos ) );
 
         if ( !aToken.isEmpty() )
         {
@@ -910,7 +909,7 @@ void InternetProxyDecider_Impl::setNoProxyList(
         if ( nEnd != nLen )
         {
             nPos = nEnd + 1;
-            nEnd = rNoProxyList.indexOf( ';', nPos );
+            nEnd = rNoProxyList.find( ';', nPos );
         }
     }
     while ( nEnd != nLen );

Reply via email to