summaryrefslogtreecommitdiff
path: root/fpicker/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-15 16:39:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-15 20:11:29 +0200
commitba74c925a5ef872c291613d4be589e1ab4b4e9e1 (patch)
tree90177f82dbfd6bdd16d92fe00a377d82cf355341 /fpicker/source
parentc5d5c7e8c385f8a7e6ab824095e61aeeca4ab8c7 (diff)
use more string_view in fpicker
Change-Id: I2568dfa05082bbd2d3a433c54b47039455d91153 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133071 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'fpicker/source')
-rw-r--r--fpicker/source/office/contentenumeration.cxx4
-rw-r--r--fpicker/source/office/contentenumeration.hxx2
-rw-r--r--fpicker/source/office/iodlg.cxx10
3 files changed, 8 insertions, 8 deletions
diff --git a/fpicker/source/office/contentenumeration.cxx b/fpicker/source/office/contentenumeration.cxx
index 737808e10b62..5b74719a3f6e 100644
--- a/fpicker/source/office/contentenumeration.cxx
+++ b/fpicker/source/office/contentenumeration.cxx
@@ -306,9 +306,9 @@ namespace svt
}
- bool FileViewContentEnumerator::URLOnDenyList ( const OUString& sRealURL )
+ bool FileViewContentEnumerator::URLOnDenyList ( std::u16string_view sRealURL )
{
- OUString entryName = sRealURL.copy( sRealURL.lastIndexOf( '/' ) + 1 );
+ std::u16string_view entryName = sRealURL.substr( sRealURL.rfind( '/' ) + 1 );
return comphelper::findValue(m_rDenyList, entryName) != -1;
}
diff --git a/fpicker/source/office/contentenumeration.hxx b/fpicker/source/office/contentenumeration.hxx
index bc2180c53c47..68277e6a4830 100644
--- a/fpicker/source/office/contentenumeration.hxx
+++ b/fpicker/source/office/contentenumeration.hxx
@@ -172,7 +172,7 @@ namespace svt
css::uno::Sequence< OUString > m_rDenyList;
- bool URLOnDenyList ( const OUString& sRealURL );
+ bool URLOnDenyList ( std::u16string_view sRealURL );
public:
/** constructs an enumerator instance
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 4090189a3cf6..d41bbab8b252 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -127,18 +127,18 @@ namespace
}
- OUString GetFsysExtension_Impl( const OUString& rFile, const OUString& rLastFilterExt )
+ OUString GetFsysExtension_Impl( std::u16string_view rFile, const OUString& rLastFilterExt )
{
- sal_Int32 nDotPos = rFile.lastIndexOf( '.' );
- if ( nDotPos != -1 )
+ size_t nDotPos = rFile.rfind( '.' );
+ if ( nDotPos != std::u16string_view::npos )
{
if ( !rLastFilterExt.isEmpty() )
{
- if ( o3tl::equalsIgnoreAsciiCase(rFile.subView( nDotPos + 1 ), rLastFilterExt ) )
+ if ( o3tl::equalsIgnoreAsciiCase(rFile.substr( nDotPos + 1 ), rLastFilterExt ) )
return rLastFilterExt;
}
else
- return rFile.copy( nDotPos );
+ return OUString(rFile.substr( nDotPos ));
}
return OUString();
}