summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ucb/source/ucp/file/bc.cxx2
-rw-r--r--ucb/source/ucp/file/filglob.cxx14
-rw-r--r--ucb/source/ucp/file/filglob.hxx4
3 files changed, 10 insertions, 10 deletions
diff --git a/ucb/source/ucp/file/bc.cxx b/ucb/source/ucp/file/bc.cxx
index fe6086160ac6..e4ed0f180333 100644
--- a/ucb/source/ucp/file/bc.cxx
+++ b/ucb/source/ucp/file/bc.cxx
@@ -1086,7 +1086,7 @@ void BaseContent::insert( sal_Int32 nMyCommandIdentifier,
XInteractionRequestImpl aRequestImpl(
rtl::Uri::decode(
- getTitle(m_aUncPath),
+ OUString(getTitle(m_aUncPath)),
rtl_UriDecodeWithCharset,
RTL_TEXTENCODING_UTF8),
static_cast<cppu::OWeakObject*>(this),
diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx
index 5772934cd161..d93c41b514de 100644
--- a/ucb/source/ucp/file/filglob.cxx
+++ b/ucb/source/ucp/file/filglob.cxx
@@ -183,17 +183,17 @@ namespace fileaccess {
}
- OUString getTitle( const OUString& aPath )
+ std::u16string_view getTitle( std::u16string_view aPath )
{
- sal_Int32 lastIndex = aPath.lastIndexOf( '/' );
- return aPath.copy( lastIndex + 1 );
+ size_t lastIndex = aPath.rfind( '/' );
+ return aPath.substr( lastIndex + 1 );
}
- OUString getParentName( const OUString& aFileName )
+ OUString getParentName( std::u16string_view aFileName )
{
- sal_Int32 lastIndex = aFileName.lastIndexOf( '/' );
- OUString aParent = aFileName.copy( 0,lastIndex );
+ size_t lastIndex = aFileName.rfind( '/' );
+ OUString aParent( aFileName.substr( 0,lastIndex ) );
if( aParent.endsWith(":") && aParent.getLength() == 6 )
aParent += "/";
@@ -561,7 +561,7 @@ namespace fileaccess {
prop.Handle = -1;
OUString aClashingName(
rtl::Uri::decode(
- getTitle(aUncPath),
+ OUString(getTitle(aUncPath)),
rtl_UriDecodeWithCharset,
RTL_TEXTENCODING_UTF8));
prop.Value <<= aClashingName;
diff --git a/ucb/source/ucp/file/filglob.hxx b/ucb/source/ucp/file/filglob.hxx
index 8d3412cdeb7b..b1235056ee18 100644
--- a/ucb/source/ucp/file/filglob.hxx
+++ b/ucb/source/ucp/file/filglob.hxx
@@ -50,12 +50,12 @@ namespace fileaccess {
std::u16string_view old_Name );
// returns the last part of the given url as title
- extern OUString getTitle( const OUString& aPath );
+ extern std::u16string_view getTitle( std::u16string_view aPath );
// returns the url without last part as parentname
// In case aFileName is root ( file:/// ) root is returned
- extern OUString getParentName( const OUString& aFileName );
+ extern OUString getParentName( std::u16string_view aFileName );
/**
* special copy: