summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-09-17 15:22:27 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-09-18 12:00:51 +0200
commit898ba5beb4db4ff30cc4409da829c3d79907f37e (patch)
tree9128a742c7f427e8fdc8fa8a3a5f4d4a31fc8bae /unotools
parentca3d526a24390df6158bf233fa63e19f5f4b1f4b (diff)
use more string_view in utl::TempFile
Change-Id: I151c66479053b9b5b7699a4938a622b4320aeaa0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140104 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/ucbhelper/tempfile.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx
index faca685d2676..5ec8df4a3263 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -246,7 +246,7 @@ namespace
};
static OUString lcl_createName(
- std::u16string_view rLeadingChars, Tokens & tokens, const OUString* pExtension,
+ std::u16string_view rLeadingChars, Tokens & tokens, std::u16string_view pExtension,
const OUString* pParent, bool bDirectory, bool bKeep, bool bLock,
bool bCreateParentDirs )
{
@@ -270,8 +270,8 @@ static OUString lcl_createName(
while (tokens.next(&token))
{
OUString aTmp( aName + token );
- if ( pExtension )
- aTmp += *pExtension;
+ if ( !pExtension.empty() )
+ aTmp += pExtension;
else
aTmp += ".tmp";
if ( bDirectory )
@@ -342,7 +342,7 @@ static OUString CreateTempName_Impl( const OUString* pParent, bool bKeep, bool b
aEyeCatcher += aPidString;
#endif
UniqueTokens t;
- return lcl_createName( aEyeCatcher, t, nullptr, pParent, bDir, bKeep,
+ return lcl_createName( aEyeCatcher, t, u"", pParent, bDir, bKeep,
false, false);
}
@@ -365,7 +365,7 @@ TempFile::TempFile( const OUString* pParent, bool bDirectory )
}
TempFile::TempFile( std::u16string_view rLeadingChars, bool _bStartWithZero,
- const OUString* pExtension, const OUString* pParent,
+ std::u16string_view pExtension, const OUString* pParent,
bool bCreateParentDirs )
: bIsDirectory( false )
, bKillingFileEnabled( false )