diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-08-11 18:17:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-12 09:32:10 +0200 |
commit | 7bdb3a77d06664a500c2ed2f3464cd56647ce089 (patch) | |
tree | d719945264a7753b0b7cb1f6d645d85a89d23984 | |
parent | b4376538d9d3dcae062d05765150a40a62be3e29 (diff) |
flatten OZipFileAccess a little
Change-Id: Ib03dadcd69a65493ddd9c0437fc654beef039ad8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120341
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | package/inc/zipfileaccess.hxx | 3 | ||||
-rw-r--r-- | package/source/zippackage/zipfileaccess.cxx | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/package/inc/zipfileaccess.hxx b/package/inc/zipfileaccess.hxx index a3f96346d6ec..b1ca8b1871bb 100644 --- a/package/inc/zipfileaccess.hxx +++ b/package/inc/zipfileaccess.hxx @@ -36,6 +36,7 @@ #include "HashMaps.hxx" #include <memory> +#include <optional> class OZipFileAccess final : public ::cppu::WeakImplHelper< css::packages::zip::XZipFileAccess2, @@ -46,7 +47,7 @@ class OZipFileAccess final : public ::cppu::WeakImplHelper< rtl::Reference<comphelper::RefCountedMutex> m_aMutexHolder; css::uno::Reference< css::uno::XComponentContext > m_xContext; css::uno::Reference< css::io::XInputStream > m_xContentStream; - std::unique_ptr<ZipFile> m_pZipFile; + std::optional<ZipFile> m_pZipFile; std::unique_ptr<::comphelper::OInterfaceContainerHelper2> m_pListenersContainer; bool m_bDisposed; bool m_bOwnContent; diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx index 5e1afc0e345f..801a9fe79e54 100644 --- a/package/source/zippackage/zipfileaccess.cxx +++ b/package/source/zippackage/zipfileaccess.cxx @@ -240,7 +240,7 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu } // TODO: in case xSeekable is implemented on separated XStream implementation a wrapper is required - m_pZipFile = std::make_unique<ZipFile>( + m_pZipFile.emplace( m_aMutexHolder, m_xContentStream, m_xContext, |