diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-28 17:56:40 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-29 16:42:33 +0100 |
commit | 042033f1e6da22616cb76c8d950c20c9efecbad5 (patch) | |
tree | 26b3f1f42d067506f44550b410f3fb9640616a5b /ucb | |
parent | ccfd8e9d09f9ac0a0ea92d0f378391006faaf934 (diff) |
loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/core/ucb.cxx | 13 | ||||
-rw-r--r-- | ucb/source/ucp/file/filglob.cxx | 4 | ||||
-rw-r--r-- | ucb/source/ucp/file/filglob.hxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/package/pkgcontent.cxx | 4 | ||||
-rw-r--r-- | ucb/source/ucp/package/pkgcontent.hxx | 5 |
5 files changed, 18 insertions, 10 deletions
diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index f49dd87a4939..ddf575cd9d5f 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -23,6 +23,11 @@ ************************************************************************** *************************************************************************/ + +#include <sal/config.h> + +#include <string_view> + #include <osl/diagnose.h> #include <sal/log.hxx> #include <rtl/ustrbuf.hxx> @@ -168,7 +173,7 @@ void makeAndAppendXMLName( } bool createContentProviderData( - const OUString & rProvider, + std::u16string_view rProvider, const uno::Reference< container::XHierarchicalNameAccess >& rxHierNameAccess, ContentProviderData & rInfo) { @@ -178,7 +183,7 @@ bool createContentProviderData( try { if ( !( rxHierNameAccess->getByHierarchicalName( - rProvider + "/ServiceName" ) >>= aValue ) ) + OUString::Concat(rProvider) + "/ServiceName" ) >>= aValue ) ) { OSL_FAIL( "UniversalContentBroker::getContentProviderData - " "Error getting item value!" ); @@ -194,7 +199,7 @@ bool createContentProviderData( // Obtain URL Template. if ( !( rxHierNameAccess->getByHierarchicalName( - rProvider + "/URLTemplate" ) >>= aValue ) ) + OUString::Concat(rProvider) + "/URLTemplate" ) >>= aValue ) ) { OSL_FAIL( "UniversalContentBroker::getContentProviderData - " "Error getting item value!" ); @@ -205,7 +210,7 @@ bool createContentProviderData( // Obtain Arguments. if ( !( rxHierNameAccess->getByHierarchicalName( - rProvider + "/Arguments" ) >>= aValue ) ) + OUString::Concat(rProvider) + "/Arguments" ) >>= aValue ) ) { OSL_FAIL( "UniversalContentBroker::getContentProviderData - " "Error getting item value!" ); diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx index 2ff92af3acb8..97e979a93edf 100644 --- a/ucb/source/ucp/file/filglob.cxx +++ b/ucb/source/ucp/file/filglob.cxx @@ -172,13 +172,13 @@ namespace fileaccess { OUString newName( - const OUString& aNewPrefix, + std::u16string_view aNewPrefix, const OUString& aOldPrefix, std::u16string_view old_Name ) { sal_Int32 srcL = aOldPrefix.getLength(); - return aNewPrefix + old_Name.substr( srcL ); + return OUString::Concat(aNewPrefix) + old_Name.substr( srcL ); } diff --git a/ucb/source/ucp/file/filglob.hxx b/ucb/source/ucp/file/filglob.hxx index ce3a32fea9f5..9c7db03debf7 100644 --- a/ucb/source/ucp/file/filglob.hxx +++ b/ucb/source/ucp/file/filglob.hxx @@ -46,7 +46,7 @@ namespace fileaccess { // Changes the prefix in name - extern OUString newName( const OUString& aNewPrefix, + extern OUString newName( std::u16string_view aNewPrefix, const OUString& aOldPrefix, std::u16string_view old_Name ); diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index 7a7204978fda..6b6cb88d4e48 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -219,9 +219,9 @@ Content* Content::create( // static OUString Content::getContentType( - const OUString& aScheme, bool bFolder ) + std::u16string_view aScheme, bool bFolder ) { - return ( "application/" + return ( OUString::Concat("application/") + aScheme + ( bFolder ? OUStringLiteral(u"-folder") diff --git a/ucb/source/ucp/package/pkgcontent.hxx b/ucb/source/ucp/package/pkgcontent.hxx index c17973775642..5bbd483ff175 100644 --- a/ucb/source/ucp/package/pkgcontent.hxx +++ b/ucb/source/ucp/package/pkgcontent.hxx @@ -20,6 +20,9 @@ #ifndef INCLUDED_UCB_SOURCE_UCP_PACKAGE_PKGCONTENT_HXX #define INCLUDED_UCB_SOURCE_UCP_PACKAGE_PKGCONTENT_HXX +#include <sal/config.h> + +#include <string_view> #include <vector> #include <rtl/ref.hxx> @@ -266,7 +269,7 @@ public: getIterator(); static OUString - getContentType( const OUString& aScheme, bool bFolder ); + getContentType( std::u16string_view aScheme, bool bFolder ); }; } |