diff options
-rw-r--r-- | unotools/source/ucbhelper/XTempFile.hxx | 5 | ||||
-rw-r--r-- | unotools/source/ucbhelper/xtempfile.cxx | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/unotools/source/ucbhelper/XTempFile.hxx b/unotools/source/ucbhelper/XTempFile.hxx index 80036263f0b9..a59abd5ae622 100644 --- a/unotools/source/ucbhelper/XTempFile.hxx +++ b/unotools/source/ucbhelper/XTempFile.hxx @@ -18,7 +18,7 @@ */ #pragma once -#include <memory> +#include <optional> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XOutputStream.hpp> #include <com/sun/star/io/XTempFile.hpp> @@ -29,6 +29,7 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <cppuhelper/implbase.hxx> #include <osl/mutex.hxx> +#include <unotools/tempfile.hxx> namespace com::sun::star::uno { class XComponentContext; } @@ -48,7 +49,7 @@ typedef ::cppu::WeakImplHelper< css::io::XTempFile class OTempFileService : public OTempFileBase { protected: - std::unique_ptr<utl::TempFile> mpTempFile; + std::optional<utl::TempFile> mpTempFile; ::osl::Mutex maMutex; SvStream* mpStream; bool mbRemoveFile; diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx index 712c788aa3e2..0cc0d8904bac 100644 --- a/unotools/source/ucbhelper/xtempfile.cxx +++ b/unotools/source/ucbhelper/xtempfile.cxx @@ -33,7 +33,7 @@ OTempFileService::OTempFileService(css::uno::Reference< css::uno::XComponentCont , mbInClosed( false ) , mbOutClosed( false ) { - mpTempFile.reset(new utl::TempFile()); + mpTempFile.emplace(); mpTempFile->EnableKillingFile(); } |