summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-21 10:07:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-21 12:20:23 +0200
commit0c3da17e4190f9fd7038d1d52a92e0748396c1d8 (patch)
tree2f2455aff5d95404acc8a49a462ef4f8d26d6231 /package
parent794be42bcc89460371d950f1c2922801dcb431f9 (diff)
pass ZipEnumeration around by value
Change-Id: I8418bd3eb6a8013f55f4283c7d96755d95a60c1a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119305 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'package')
-rw-r--r--package/inc/ZipFile.hxx2
-rw-r--r--package/source/zipapi/ZipFile.cxx4
-rw-r--r--package/source/zippackage/ZipPackage.cxx6
3 files changed, 6 insertions, 6 deletions
diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx
index 01a7b562edcc..abfb6674ae18 100644
--- a/package/inc/ZipFile.hxx
+++ b/package/inc/ZipFile.hxx
@@ -165,7 +165,7 @@ public:
const OUString& aMediaType,
const rtl::Reference<comphelper::RefCountedMutex>& aMutexHolder );
- std::unique_ptr<ZipEnumeration> entries();
+ ZipEnumeration entries();
};
#endif
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index e0c07537b749..02c2253182b0 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -660,9 +660,9 @@ uno::Reference< XInputStream > ZipFile::createStreamForZipEntry(
return xBufStream;
}
-std::unique_ptr<ZipEnumeration> ZipFile::entries()
+ZipEnumeration ZipFile::entries()
{
- return std::make_unique<ZipEnumeration>(aEntries);
+ return aEntries;
}
uno::Reference< XInputStream > ZipFile::getInputStream( ZipEntry& rEntry,
diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 0bf1b331fd5f..2e4e9c2b2c21 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -519,16 +519,16 @@ void ZipPackage::parseContentType()
void ZipPackage::getZipFileContents()
{
- std::unique_ptr<ZipEnumeration> xEnum = m_pZipFile->entries();
+ ZipEnumeration aEnum = m_pZipFile->entries();
OUString sTemp, sDirName;
sal_Int32 nOldIndex, nStreamIndex;
FolderHash::iterator aIter;
- while (xEnum->hasMoreElements())
+ while (aEnum.hasMoreElements())
{
nOldIndex = 0;
ZipPackageFolder* pCurrent = m_xRootFolder.get();
- const ZipEntry & rEntry = *xEnum->nextElement();
+ const ZipEntry & rEntry = *aEnum.nextElement();
OUString rName = rEntry.sPath;
if ( m_bForceRecovery )