diff --git a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx index a74524e70f35..8e77576134bb 100644 --- a/ucb/source/ucp/hierarchy/hierarchydatasource.cxx +++ b/ucb/source/ucp/hierarchy/hierarchydatasource.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -443,18 +444,18 @@ HierarchyDataSource::getConfigProvider() bool HierarchyDataSource::createConfigPath( - const OUString & rInPath, OUString & rOutPath ) + std::u16string_view rInPath, OUString & rOutPath ) { - if ( !rInPath.isEmpty() ) + if ( !rInPath.empty() ) { - if ( rInPath.startsWith( "/" ) ) + if ( o3tl::starts_with( rInPath, u"/" ) ) { OSL_FAIL( "HierarchyDataSource::createConfigPath - " "Leading slash in node path!" ); return false; } - if ( rInPath.endsWith( "/" ) ) + if ( o3tl::ends_with( rInPath, u"/" ) ) { OSL_FAIL( "HierarchyDataSource::createConfigPath - " "Trailing slash in node path!" ); diff --git a/ucb/source/ucp/hierarchy/hierarchydatasource.hxx b/ucb/source/ucp/hierarchy/hierarchydatasource.hxx index 9806f98f8036..24b3a18491d6 100644 --- a/ucb/source/ucp/hierarchy/hierarchydatasource.hxx +++ b/ucb/source/ucp/hierarchy/hierarchydatasource.hxx @@ -27,6 +27,7 @@ #include #include #include +#include namespace comphelper { class OInterfaceContainerHelper2; } @@ -75,7 +76,7 @@ private: css::uno::Reference< css::lang::XMultiServiceFactory > getConfigProvider(); - static bool createConfigPath( const OUString & rInPath, OUString & rOutPath ); + static bool createConfigPath( std::u16string_view rInPath, OUString & rOutPath ); }; } // namespace hierarchy_ucp diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index dcb800ee91c8..5a1335e1efc9 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -28,6 +28,7 @@ #include +#include #include #include #include @@ -1709,7 +1710,7 @@ void Content::notifyDocumentClosed() uno::Reference< ucb::XContent > -Content::queryChildContent( const OUString & rRelativeChildUri ) +Content::queryChildContent( std::u16string_view rRelativeChildUri ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); @@ -1717,10 +1718,10 @@ Content::queryChildContent( const OUString & rRelativeChildUri ) OUStringBuffer aBuf( aMyId ); if ( !aMyId.endsWith("/") ) aBuf.append( "/" ); - if ( !rRelativeChildUri.startsWith("/") ) + if ( !o3tl::starts_with(rRelativeChildUri, u"/") ) aBuf.append( rRelativeChildUri ); else - aBuf.append( rRelativeChildUri.subView(1) ); + aBuf.append( rRelativeChildUri.substr(1) ); uno::Reference< ucb::XContentIdentifier > xChildId = new ::ucbhelper::ContentIdentifier( aBuf.makeStringAndClear() ); @@ -1741,7 +1742,7 @@ Content::queryChildContent( const OUString & rRelativeChildUri ) } -void Content::notifyChildRemoved( const OUString & rRelativeChildUri ) +void Content::notifyChildRemoved( std::u16string_view rRelativeChildUri ) { osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex ); @@ -1765,7 +1766,7 @@ void Content::notifyChildRemoved( const OUString & rRelativeChildUri ) } -void Content::notifyChildInserted( const OUString & rRelativeChildUri ) +void Content::notifyChildInserted( std::u16string_view rRelativeChildUri ) { osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex ); diff --git a/ucb/source/ucp/tdoc/tdoc_content.hxx b/ucb/source/ucp/tdoc/tdoc_content.hxx index 56117b1b0853..9a920c1bb376 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.hxx +++ b/ucb/source/ucp/tdoc/tdoc_content.hxx @@ -19,6 +19,10 @@ #pragma once +#include + +#include + #include #include #include "tdoc_provider.hxx" @@ -190,7 +194,7 @@ private: const css::uno::Reference< css::ucb::XCommandEnvironment > & xEnv ); css::uno::Reference< css::ucb::XContent > - queryChildContent( const OUString & rRelativeChildUri ); + queryChildContent( std::u16string_view rRelativeChildUri ); /// @throws css::ucb::CommandFailedException /// @throws css::task::DocumentPasswordRequest @@ -266,8 +270,8 @@ public: const OUString& rContentId ); void notifyDocumentClosed(); - void notifyChildRemoved( const OUString & rRelativeChildUri ); - void notifyChildInserted( const OUString & rRelativeChildUri ); + void notifyChildRemoved( std::u16string_view rRelativeChildUri ); + void notifyChildInserted( std::u16string_view rRelativeChildUri ); rtl::Reference< ContentProvider > getContentProvider() const { return rtl::Reference< ContentProvider >( m_pProvider ); } diff --git a/ucb/source/ucp/tdoc/tdoc_provider.cxx b/ucb/source/ucp/tdoc/tdoc_provider.cxx index 93d49ca2108b..23fd324a550b 100644 --- a/ucb/source/ucp/tdoc/tdoc_provider.cxx +++ b/ucb/source/ucp/tdoc/tdoc_provider.cxx @@ -229,7 +229,7 @@ ContentProvider::createDocumentContent( // virtual -void ContentProvider::notifyDocumentClosed( const OUString & rDocId ) +void ContentProvider::notifyDocumentClosed( std::u16string_view rDocId ) { osl::MutexGuard aGuard( getContentListMutex() ); @@ -287,7 +287,7 @@ void ContentProvider::notifyDocumentClosed( const OUString & rDocId ) // virtual -void ContentProvider::notifyDocumentOpened( const OUString & rDocId ) +void ContentProvider::notifyDocumentOpened( std::u16string_view rDocId ) { osl::MutexGuard aGuard( getContentListMutex() ); diff --git a/ucb/source/ucp/tdoc/tdoc_provider.hxx b/ucb/source/ucp/tdoc/tdoc_provider.hxx index 406252ff23d3..44bc239f7c6e 100644 --- a/ucb/source/ucp/tdoc/tdoc_provider.hxx +++ b/ucb/source/ucp/tdoc/tdoc_provider.hxx @@ -19,6 +19,10 @@ #pragma once +#include + +#include + #include #include #include @@ -129,8 +133,8 @@ public: queryDocumentModel( const OUString & rUri ) const; // interface OfficeDocumentsEventListener - void notifyDocumentOpened( const OUString & rDocId ); - void notifyDocumentClosed( const OUString & rDocId ); + void notifyDocumentOpened( std::u16string_view rDocId ); + void notifyDocumentClosed( std::u16string_view rDocId ); private: rtl::Reference< OfficeDocumentsManager > m_xDocsMgr; diff --git a/ucb/source/ucp/webdav-neon/DAVProperties.cxx b/ucb/source/ucp/webdav-neon/DAVProperties.cxx index 575385f5d2d8..b1a4a0273ef8 100644 --- a/ucb/source/ucp/webdav-neon/DAVProperties.cxx +++ b/ucb/source/ucp/webdav-neon/DAVProperties.cxx @@ -35,38 +35,38 @@ using namespace webdav_ucp; -void DAVProperties::createNeonPropName( const OUString & rFullName, +void DAVProperties::createNeonPropName( std::u16string_view rFullName, NeonPropName & rName ) { - if ( rFullName.startsWith( "DAV:" ) ) + if ( o3tl::starts_with( rFullName, u"DAV:" ) ) { rName.nspace = "DAV:"; rName.name = strdup( OUStringToOString( - rFullName.subView( RTL_CONSTASCII_LENGTH( "DAV:" ) ), + rFullName.substr( RTL_CONSTASCII_LENGTH( "DAV:" ) ), RTL_TEXTENCODING_UTF8 ).getStr() ); } - else if ( rFullName.startsWith( "http://apache.org/dav/props/" ) ) + else if ( o3tl::starts_with( rFullName, u"http://apache.org/dav/props/" ) ) { rName.nspace = "http://apache.org/dav/props/"; rName.name = strdup( OUStringToOString( - rFullName.subView( + rFullName.substr( RTL_CONSTASCII_LENGTH( "http://apache.org/dav/props/" ) ), RTL_TEXTENCODING_UTF8 ).getStr() ); } - else if ( rFullName.startsWith( "http://ucb.openoffice.org/dav/props/" ) ) + else if ( o3tl::starts_with( rFullName, u"http://ucb.openoffice.org/dav/props/" ) ) { rName.nspace = "http://ucb.openoffice.org/dav/props/"; rName.name = strdup( OUStringToOString( - rFullName.subView( + rFullName.substr( RTL_CONSTASCII_LENGTH( "http://ucb.openoffice.org/dav/props/" ) ), RTL_TEXTENCODING_UTF8 ).getStr() ); } - else if ( rFullName.startsWith( " + +#include + #include #include #include "NeonTypes.hxx" @@ -49,7 +53,7 @@ struct DAVProperties static constexpr OUStringLiteral SUPPORTEDLOCK = u"DAV:supportedlock"; static constexpr OUStringLiteral EXECUTABLE = u"http://apache.org/dav/props/executable"; - static void createNeonPropName( const OUString & rFullName, + static void createNeonPropName( std::u16string_view rFullName, NeonPropName & rName ); static void createUCBPropName ( const char * nspace, const char * name,