From 1ea0ea19f1dc13c4191ab9d4222adfd2579b802c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 24 Oct 2022 09:06:42 +0200 Subject: tdf#133768 speed up temp file creation Use DELETE_ON_CLOSE attribute, so we can avoid calling osl_removeFile. Shaves 5% off the export time. Change-Id: I4fef8f181ef7a92c4805cc5996c3a17800a22602 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141718 Tested-by: Noel Grandin Reviewed-by: Noel Grandin --- tools/source/stream/strmwnt.cxx | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools') diff --git a/tools/source/stream/strmwnt.cxx b/tools/source/stream/strmwnt.cxx index 4ea9c7eb1d42..f88cbe307606 100644 --- a/tools/source/stream/strmwnt.cxx +++ b/tools/source/stream/strmwnt.cxx @@ -304,6 +304,8 @@ void SvFileStream::Open( const OUString& rFilename, StreamMode nMode ) if ( nMode & StreamMode::TEMPORARY ) nAttributes |= FILE_ATTRIBUTE_TEMPORARY; + if ( nMode & StreamMode::DELETE_ON_CLOSE ) + nAttributes |= FILE_FLAG_DELETE_ON_CLOSE; pInstanceData->hFile = CreateFileW( o3tl::toW(aFilename.getStr()), -- cgit v1.2.3