summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-09-22 23:25:49 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-09-23 07:26:38 +0200
commit310d43b9a27efc36f2c9e6737a0b5ac3f211bda0 (patch)
tree9255633ffc927078eb3ed9f6a4b8f3662ca7fba3 /extensions
parent047a983314b560e0f64280ae2ac7d696d90d539b (diff)
Extend loplugin:stringviewparam to starts/endsWith: extensions
Change-Id: I29c3a09628f213d8b229a981d62421390385c54e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122499 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/update/check/download.cxx9
-rw-r--r--extensions/source/update/check/download.hxx6
2 files changed, 10 insertions, 5 deletions
diff --git a/extensions/source/update/check/download.cxx b/extensions/source/update/check/download.cxx
index 1f98b7717be2..905d16e99a7f 100644
--- a/extensions/source/update/check/download.cxx
+++ b/extensions/source/update/check/download.cxx
@@ -23,6 +23,7 @@
#include <curl/curl.h>
+#include <o3tl/string_view.hxx>
#include <osl/diagnose.h>
#include <osl/file.h>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -168,7 +169,7 @@ progress_callback( void *clientp, double dltotal, double dlnow, SAL_UNUSED_PARAM
void
-Download::getProxyForURL(const OUString& rURL, OString& rHost, sal_Int32& rPort) const
+Download::getProxyForURL(std::u16string_view rURL, OString& rHost, sal_Int32& rPort) const
{
uno::Reference< lang::XMultiServiceFactory > xConfigProvider(
css::configuration::theDefaultProvider::get( m_xContext ) );
@@ -191,17 +192,17 @@ Download::getProxyForURL(const OUString& rURL, OString& rHost, sal_Int32& rPort)
sal_Int32 nProxyType = aValue.get< sal_Int32 >();
if( 0 != nProxyType ) // type 0 means "direct connection to the internet
{
- if( rURL.startsWith("http:") )
+ if( o3tl::starts_with(rURL, u"http:") )
{
rHost = getStringValue(xNameAccess, "ooInetHTTPProxyName");
rPort = getInt32Value(xNameAccess, "ooInetHTTPProxyPort");
}
- else if( rURL.startsWith("https:") )
+ else if( o3tl::starts_with(rURL, u"https:") )
{
rHost = getStringValue(xNameAccess, "ooInetHTTPSProxyName");
rPort = getInt32Value(xNameAccess, "ooInetHTTPSProxyPort");
}
- else if( rURL.startsWith("ftp:") )
+ else if( o3tl::starts_with(rURL, u"ftp:") )
{
rHost = getStringValue(xNameAccess, "ooInetFTPProxyName");
rPort = getInt32Value(xNameAccess, "ooInetFTPProxyPort");
diff --git a/extensions/source/update/check/download.hxx b/extensions/source/update/check/download.hxx
index 2440ce4cec85..12a11ddde091 100644
--- a/extensions/source/update/check/download.hxx
+++ b/extensions/source/update/check/download.hxx
@@ -19,6 +19,10 @@
#pragma once
+#include <sal/config.h>
+
+#include <string_view>
+
#include <com/sun/star/uno/XComponentContext.hpp>
#include <rtl/ref.hxx>
@@ -65,7 +69,7 @@ public:
protected:
// Determines the appropriate proxy settings for the given URL. Returns true if a proxy should be used
- void getProxyForURL(const OUString& rURL, OString& rHost, sal_Int32& rPort) const;
+ void getProxyForURL(std::u16string_view rURL, OString& rHost, sal_Int32& rPort) const;
private:
osl::Condition m_aCondition;