summaryrefslogtreecommitdiff
path: root/idl/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-03 10:34:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-17 10:27:33 +0200
commit33bd16b344e273c427091ee68e946bf67b371dd7 (patch)
tree85fb383ea8e3d30f393bb197b5c74f73f6ca247f /idl/source
parentfe597a337914decd62480d3eba84258333116db9 (diff)
loplugin:stringviewparam convert methods using copy()
which converts to std::string_view::substr() Change-Id: I3f42213b41a97e77ddcc79d84d512f49d68ca559 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132729 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'idl/source')
-rw-r--r--idl/source/prj/svidl.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/idl/source/prj/svidl.cxx b/idl/source/prj/svidl.cxx
index efc6bf2946df..2c9fbf63d770 100644
--- a/idl/source/prj/svidl.cxx
+++ b/idl/source/prj/svidl.cxx
@@ -79,14 +79,14 @@ static bool FileMove_Impl( const OUString & rFile1, const OUString & rFile2, boo
//This function gets a system path to a file [fname], creates a temp file in
//the same folder as [fname] and returns the system path of the temp file.
-static OUString tempFileHelper(OUString const & fname)
+static OUString tempFileHelper(std::u16string_view fname)
{
OUString aTmpFile;
- sal_Int32 delimIndex = fname.lastIndexOf( '/' );
- if( delimIndex > 0 )
+ size_t delimIndex = fname.rfind( '/' );
+ if( delimIndex > 0 && delimIndex != std::u16string_view::npos)
{
- OUString aTmpDir( fname.copy( 0, delimIndex ) );
+ OUString aTmpDir( fname.substr( 0, delimIndex ) );
osl::FileBase::getFileURLFromSystemPath( aTmpDir, aTmpDir );
osl::FileBase::createTempFile( &aTmpDir, nullptr, &aTmpFile );
osl::FileBase::getSystemPathFromFileURL( aTmpFile, aTmpFile );