diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-11 17:44:34 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-11 21:25:10 +0100 |
commit | 35e471bb4d1388cf5afcdcee214cf5111edf44e3 (patch) | |
tree | bb78f4f13f131f0cb206a9707cc3cfc495a3876a /ucb/source | |
parent | 0c06e77c122f10a1842bc908bd6e25b1110ddbd2 (diff) |
Adapt the remaining OUString functions to std string_view
...for LIBO_INTERNAL_ONLY. These had been missed by
1b43cceaea2084a0489db68cd0113508f34b6643 "Make many OUString functions take
std::u16string_view parameters" because they did not match the multi-overload
pattern that was addressed there, but they nevertheless benefit from being
changed just as well (witness e.g. the various resulting changes from copy() to
subView()).
This showed a conversion from OStringChar to std::string_view to be missing
(while the corresponding conversion form OUStringChar to std::u16string_view was
already present).
The improvement to loplugin:stringadd became necessary to fix
> [CPT] compilerplugins/clang/test/stringadd.cxx
> error: 'error' diagnostics expected but not seen:
> File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 43 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:42): simplify by merging with the preceding assignment [loplugin:stringadd]
> File ~/lo/core/compilerplugins/clang/test/stringadd.cxx Line 61 (directive at ~/lo/core/compilerplugins/clang/test/stringadd.cxx:60): simplify by merging with the preceding assignment [loplugin:stringadd]
> 2 errors generated.
Change-Id: Ie40de0616a66e60e289c1af0ca60aed6f9ecc279
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107602
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'ucb/source')
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/cmis/cmis_content.hxx | 6 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/DAVProperties.cxx | 6 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/NeonLockStore.cxx | 2 | ||||
-rw-r--r-- | ucb/source/ucp/webdav-neon/NeonLockStore.hxx | 3 |
5 files changed, 12 insertions, 7 deletions
diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index cf12bdd8409f..14cdb1bbddc7 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -1249,7 +1249,7 @@ namespace cmis } void Content::insert( const uno::Reference< io::XInputStream > & xInputStream, - bool bReplaceExisting, const OUString& rMimeType, + bool bReplaceExisting, std::u16string_view rMimeType, const uno::Reference< ucb::XCommandEnvironment >& xEnv ) { if ( !xInputStream.is() ) diff --git a/ucb/source/ucp/cmis/cmis_content.hxx b/ucb/source/ucp/cmis/cmis_content.hxx index 20f4bfe21a98..a0a301305473 100644 --- a/ucb/source/ucp/cmis/cmis_content.hxx +++ b/ucb/source/ucp/cmis/cmis_content.hxx @@ -10,6 +10,10 @@ #ifndef INCLUDED_UCB_SOURCE_UCP_CMIS_CMIS_CONTENT_HXX #define INCLUDED_UCB_SOURCE_UCP_CMIS_CMIS_CONTENT_HXX +#include <sal/config.h> + +#include <string_view> + #include "cmis_url.hxx" #include "children_provider.hxx" @@ -104,7 +108,7 @@ private: /// @throws css::uno::Exception void insert( const css::uno::Reference< css::io::XInputStream > & xInputStream, - bool bReplaceExisting, const OUString & rMimeType, + bool bReplaceExisting, std::u16string_view rMimeType, const css::uno::Reference< css::ucb::XCommandEnvironment >& xEnv ); /// @throws css::uno::Exception diff --git a/ucb/source/ucp/webdav-neon/DAVProperties.cxx b/ucb/source/ucp/webdav-neon/DAVProperties.cxx index d3ed70cbe94a..575385f5d2d8 100644 --- a/ucb/source/ucp/webdav-neon/DAVProperties.cxx +++ b/ucb/source/ucp/webdav-neon/DAVProperties.cxx @@ -43,7 +43,7 @@ void DAVProperties::createNeonPropName( const OUString & rFullName, rName.nspace = "DAV:"; rName.name = strdup( OUStringToOString( - rFullName.copy( RTL_CONSTASCII_LENGTH( "DAV:" ) ), + rFullName.subView( RTL_CONSTASCII_LENGTH( "DAV:" ) ), RTL_TEXTENCODING_UTF8 ).getStr() ); } else if ( rFullName.startsWith( "http://apache.org/dav/props/" ) ) @@ -51,7 +51,7 @@ void DAVProperties::createNeonPropName( const OUString & rFullName, rName.nspace = "http://apache.org/dav/props/"; rName.name = strdup( OUStringToOString( - rFullName.copy( + rFullName.subView( RTL_CONSTASCII_LENGTH( "http://apache.org/dav/props/" ) ), RTL_TEXTENCODING_UTF8 ).getStr() ); @@ -61,7 +61,7 @@ void DAVProperties::createNeonPropName( const OUString & rFullName, rName.nspace = "http://ucb.openoffice.org/dav/props/"; rName.name = strdup( OUStringToOString( - rFullName.copy( + rFullName.subView( RTL_CONSTASCII_LENGTH( "http://ucb.openoffice.org/dav/props/" ) ), RTL_TEXTENCODING_UTF8 ).getStr() ); diff --git a/ucb/source/ucp/webdav-neon/NeonLockStore.cxx b/ucb/source/ucp/webdav-neon/NeonLockStore.cxx index a4d25b4b1e31..c00f18627fa0 100644 --- a/ucb/source/ucp/webdav-neon/NeonLockStore.cxx +++ b/ucb/source/ucp/webdav-neon/NeonLockStore.cxx @@ -159,7 +159,7 @@ void NeonLockStore::registerSession( HttpSession * pHttpSession ) ne_lockstore_register( m_pNeonLockStore, pHttpSession ); } -NeonLock * NeonLockStore::findByUri( OUString const & rUri ) +NeonLock * NeonLockStore::findByUri( std::u16string_view rUri ) { osl::MutexGuard aGuard( m_aMutex ); diff --git a/ucb/source/ucp/webdav-neon/NeonLockStore.hxx b/ucb/source/ucp/webdav-neon/NeonLockStore.hxx index fa64cb320374..323a71ab1e6f 100644 --- a/ucb/source/ucp/webdav-neon/NeonLockStore.hxx +++ b/ucb/source/ucp/webdav-neon/NeonLockStore.hxx @@ -30,6 +30,7 @@ #include <config_lgpl.h> #include <map> +#include <string_view> #include <ne_locks.h> @@ -74,7 +75,7 @@ public: void registerSession( HttpSession * pHttpSession ); - NeonLock * findByUri( OUString const & rUri ); + NeonLock * findByUri( std::u16string_view rUri ); void addLock( NeonLock * pLock, rtl::Reference< NeonSession > const & xSession, |