[Libreoffice-commits] core.git: package/inc package/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Thu Aug 12 07:32:37 UTC 2021
package/inc/ZipPackage.hxx | 4 +++-
package/source/zippackage/ZipPackage.cxx | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
New commits:
commit b4376538d9d3dcae062d05765150a40a62be3e29
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Wed Aug 11 18:16:10 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Aug 12 09:31:52 2021 +0200
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 at collabora.co.uk>
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
More information about the Libreoffice-commits
mailing list