summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-08-11 18:16:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-12 09:31:52 +0200
commitb4376538d9d3dcae062d05765150a40a62be3e29 (patch)
treef36d5be902ee945b9857d435b7d89232864922a2 /package
parentf9871d218bcae184a5845d63366175ea2df2086a (diff)
flatten ZipPackage a little
Change-Id: I0295bd8d72686996afb9d361db12b6014594b402 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120340 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'package')
-rw-r--r--package/inc/ZipPackage.hxx4
-rw-r--r--package/source/zippackage/ZipPackage.cxx4
2 files changed, 5 insertions, 3 deletions
diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx
index 64b94ffb8a72..77d0130f0b9b 100644
--- a/package/inc/ZipPackage.hxx
+++ b/package/inc/ZipPackage.hxx
@@ -35,9 +35,11 @@
#include <rtl/ref.hxx>
#include "HashMaps.hxx"
+#include "ZipFile.hxx"
#include <osl/file.h>
#include <vector>
#include <memory>
+#include <optional>
class ZipOutputStream;
class ZipPackageFolder;
@@ -99,7 +101,7 @@ class ZipPackage final : public cppu::WeakImplHelper
css::uno::Reference < css::io::XSeekable > m_xContentSeek;
const css::uno::Reference < css::uno::XComponentContext > m_xContext;
- std::unique_ptr<ZipFile> m_pZipFile;
+ std::optional<ZipFile> m_pZipFile;
bool m_bDisableFileSync = false;
bool isLocalFile() const;
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 2e4e9c2b2c21..527dcbe203dd 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -772,7 +772,7 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments )
OUString message;
try
{
- m_pZipFile = std::make_unique<ZipFile>(m_aMutexHolder, m_xContentStream, m_xContext, true, m_bForceRecovery);
+ m_pZipFile.emplace(m_aMutexHolder, m_xContentStream, m_xContext, true, m_bForceRecovery);
getZipFileContents();
}
catch ( IOException & e )
@@ -1144,7 +1144,7 @@ void ZipPackage::ConnectTo( const uno::Reference< io::XInputStream >& xInStream
if ( m_pZipFile )
m_pZipFile->setInputStream( m_xContentStream );
else
- m_pZipFile = std::make_unique<ZipFile>(m_aMutexHolder, m_xContentStream, m_xContext, false);
+ m_pZipFile.emplace(m_aMutexHolder, m_xContentStream, m_xContext, false);
}
namespace