From 8332d6d8200e8ca1f22dd98d9373efd5a431d09c Mon Sep 17 00:00:00 2001 From: Noel Date: Wed, 25 Nov 2020 08:14:07 +0200 Subject: loplugin:stringviewparam include comparisons with string literals Change-Id: I8ba1214500dddaf413c506a4b82f43d63cda804b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106559 Tested-by: Jenkins Reviewed-by: Noel Grandin --- ucb/source/ucp/hierarchy/hierarchydatasource.cxx | 6 +++--- ucb/source/ucp/hierarchy/hierarchydatasource.hxx | 2 +- ucb/source/ucp/tdoc/tdoc_content.cxx | 2 +- ucb/source/ucp/tdoc/tdoc_provider.hxx | 8 ++++---- ucb/source/ucp/webdav-neon/DateTimeHelper.cxx | 26 ++++++++++++------------ ucb/source/ucp/webdav-neon/DateTimeHelper.hxx | 2 +- 6 files changed, 23 insertions(+), 23 deletions(-) (limited to 'ucb/source') diff --git a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx index 8b61c375f896..04162051b46e 100644 --- a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx @@ -48,8 +48,8 @@ using namespace hierarchy_ucp; // describe path of cfg entry #define CFGPROPERTY_NODEPATH "nodepath" -#define READ_SERVICE_NAME "com.sun.star.ucb.HierarchyDataReadAccess" -#define READWRITE_SERVICE_NAME "com.sun.star.ucb.HierarchyDataReadWriteAccess" +#define READ_SERVICE_NAME u"com.sun.star.ucb.HierarchyDataReadAccess" +#define READWRITE_SERVICE_NAME u"com.sun.star.ucb.HierarchyDataReadWriteAccess" #define CONFIG_DATA_ROOT_KEY \ "/org.openoffice.ucb.Hierarchy/Root" @@ -304,7 +304,7 @@ HierarchyDataSource::getAvailableServiceNames() uno::Reference< uno::XInterface > HierarchyDataSource::createInstanceWithArguments( - const OUString & ServiceSpecifier, + std::u16string_view ServiceSpecifier, const uno::Sequence< uno::Any > & Arguments, bool bCheckArgs ) { diff --git a/ucb/source/ucp/hierarchy/hierarchydatasource.hxx b/ucb/source/ucp/hierarchy/hierarchydatasource.hxx index e21d7acda551..d924fbc9b1d4 100644 --- a/ucb/source/ucp/hierarchy/hierarchydatasource.hxx +++ b/ucb/source/ucp/hierarchy/hierarchydatasource.hxx @@ -69,7 +69,7 @@ public: private: /// @throws css::uno::Exception - css::uno::Reference< css::uno::XInterface > createInstanceWithArguments( const OUString & ServiceSpecifier, + css::uno::Reference< css::uno::XInterface > createInstanceWithArguments( std::u16string_view ServiceSpecifier, const css::uno::Sequence< css::uno::Any > & Arguments, bool bCheckArgs ); diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index bf64d4d0146d..04cd62ee9fba 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -81,7 +81,7 @@ using namespace com::sun::star; using namespace tdoc_ucp; -static ContentType lcl_getContentType( const OUString & rType ) +static ContentType lcl_getContentType( std::u16string_view rType ) { if ( rType == TDOC_ROOT_CONTENT_TYPE ) return ROOT; diff --git a/ucb/source/ucp/tdoc/tdoc_provider.hxx b/ucb/source/ucp/tdoc/tdoc_provider.hxx index b105ac9367a3..d9e4814bc9c3 100644 --- a/ucb/source/ucp/tdoc/tdoc_provider.hxx +++ b/ucb/source/ucp/tdoc/tdoc_provider.hxx @@ -42,13 +42,13 @@ namespace tdoc_ucp { #define TDOC_ROOT_CONTENT_TYPE \ - "application/" TDOC_URL_SCHEME "-root" + u"application/" TDOC_URL_SCHEME "-root" #define TDOC_DOCUMENT_CONTENT_TYPE \ - "application/" TDOC_URL_SCHEME "-document" + u"application/" TDOC_URL_SCHEME "-document" #define TDOC_FOLDER_CONTENT_TYPE \ - "application/" TDOC_URL_SCHEME "-folder" + u"application/" TDOC_URL_SCHEME "-folder" #define TDOC_STREAM_CONTENT_TYPE \ - "application/" TDOC_URL_SCHEME "-stream" + u"application/" TDOC_URL_SCHEME "-stream" class StorageElementFactory; diff --git a/ucb/source/ucp/webdav-neon/DateTimeHelper.cxx b/ucb/source/ucp/webdav-neon/DateTimeHelper.cxx index 88ca23f16ff7..a50d2db55787 100644 --- a/ucb/source/ucp/webdav-neon/DateTimeHelper.cxx +++ b/ucb/source/ucp/webdav-neon/DateTimeHelper.cxx @@ -114,31 +114,31 @@ bool DateTimeHelper::ISO8601_To_DateTime (const OUString& s, return false; } -sal_Int32 DateTimeHelper::convertMonthToInt (const OUString& month) +sal_Int32 DateTimeHelper::convertMonthToInt (std::u16string_view month) { - if (month == "Jan") + if (month == u"Jan") return 1; - else if (month == "Feb") + else if (month == u"Feb") return 2; - else if (month == "Mar") + else if (month == u"Mar") return 3; - else if (month == "Apr") + else if (month == u"Apr") return 4; - else if (month == "May") + else if (month == u"May") return 5; - else if (month == "Jun") + else if (month == u"Jun") return 6; - else if (month == "Jul") + else if (month == u"Jul") return 7; - else if (month == "Aug") + else if (month == u"Aug") return 8; - else if (month == "Sep") + else if (month == u"Sep") return 9; - else if (month == "Oct") + else if (month == u"Oct") return 10; - else if (month == "Nov") + else if (month == u"Nov") return 11; - else if (month == "Dec") + else if (month == u"Dec") return 12; else return 0; diff --git a/ucb/source/ucp/webdav-neon/DateTimeHelper.hxx b/ucb/source/ucp/webdav-neon/DateTimeHelper.hxx index 5abf6d400668..618814614bfb 100644 --- a/ucb/source/ucp/webdav-neon/DateTimeHelper.hxx +++ b/ucb/source/ucp/webdav-neon/DateTimeHelper.hxx @@ -44,7 +44,7 @@ namespace webdav_ucp class DateTimeHelper { private: - static sal_Int32 convertMonthToInt (const OUString& ); + static sal_Int32 convertMonthToInt (std::u16string_view ); static bool ISO8601_To_DateTime (const OUString&, css::util::DateTime& ); -- cgit v1.2.3