summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-18 12:27:59 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-18 18:01:19 +0200
commit4743a32b4f991c57e4b8a66adf035b1808ca793a (patch)
tree98c99528c86c8faddb3d61a0dac70f0716b1ee1a /unotools
parent4bd95a0d5c962cc0bb8e90c32300c69ae8e92c1d (diff)
only need to create the folder for temp files once
Change-Id: I805203dc51ca85515150fe0f28fc6464c45453c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134523 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/ucbhelper/tempfile.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx
index e912c609337b..83a523a2bd9b 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -142,19 +142,18 @@ static OUString ConstructTempDir_Impl( const OUString* pParent, bool bCreatePare
if ( aName.isEmpty() )
{
- OUString &rTempNameBase_Impl = gTempNameBase_Impl;
- if (rTempNameBase_Impl.isEmpty())
+ if (gTempNameBase_Impl.isEmpty())
{
OUString ustrTempDirURL;
::osl::FileBase::RC rc = ::osl::File::getTempDirURL(
ustrTempDirURL );
if (rc == ::osl::FileBase::E_None)
- rTempNameBase_Impl = ustrTempDirURL;
+ gTempNameBase_Impl = ustrTempDirURL;
+ ensuredir( aName );
}
// if no parent or invalid parent : use default directory
- DBG_ASSERT( !rTempNameBase_Impl.isEmpty(), "No TempDir!" );
- aName = rTempNameBase_Impl;
- ensuredir( aName );
+ DBG_ASSERT( !gTempNameBase_Impl.isEmpty(), "No TempDir!" );
+ aName = gTempNameBase_Impl;
}
// Make sure that directory ends with a separator