summaryrefslogtreecommitdiff
path: root/package/source/zipapi/ZipOutputStream.cxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2019-05-24 22:05:30 +0200
committerLuboš Luňák <l.lunak@collabora.com>2019-05-28 12:27:48 +0200
commit7cd3f267cfbf3655f6a7a395b80560ecd22e15f7 (patch)
treee14173cddc4e4fb5b0709a7ae64d90316da0b76a /package/source/zipapi/ZipOutputStream.cxx
parentee22409ab6187d3545db71d255ec3866262baa6e (diff)
split out thread functionality from ZipOutputEntry
It can be easily separated out, it looked like hacked in. And I will need to do more refactoring of the class, so this shouldn't be more complex than necessary. Change-Id: I302da55409e9195274907ca4939c37fbb2427b18 Reviewed-on: https://gerrit.libreoffice.org/73031 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'package/source/zipapi/ZipOutputStream.cxx')
-rw-r--r--package/source/zipapi/ZipOutputStream.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx
index 5d90224981b0..8ea040bd55e3 100644
--- a/package/source/zipapi/ZipOutputStream.cxx
+++ b/package/source/zipapi/ZipOutputStream.cxx
@@ -68,7 +68,7 @@ void ZipOutputStream::setEntry( ZipEntry *pEntry )
}
}
-void ZipOutputStream::addDeflatingThreadTask( ZipOutputEntry *pEntry, std::unique_ptr<comphelper::ThreadTask> pTask )
+void ZipOutputStream::addDeflatingThreadTask( ZipOutputEntryInThread *pEntry, std::unique_ptr<comphelper::ThreadTask> pTask )
{
comphelper::ThreadPool::getSharedOptimalPool().pushTask(std::move(pTask));
m_aEntries.push_back(pEntry);
@@ -91,7 +91,7 @@ void ZipOutputStream::rawCloseEntry( bool bEncrypt )
m_pCurrentEntry = nullptr;
}
-void ZipOutputStream::consumeScheduledThreadTaskEntry(std::unique_ptr<ZipOutputEntry> pCandidate)
+void ZipOutputStream::consumeScheduledThreadTaskEntry(std::unique_ptr<ZipOutputEntryInThread> pCandidate)
{
//Any exceptions thrown in the threads were caught and stored for now
const std::exception_ptr& rCaughtException(pCandidate->getParallelDeflateException());
@@ -126,13 +126,13 @@ void ZipOutputStream::consumeScheduledThreadTaskEntry(std::unique_ptr<ZipOutputE
void ZipOutputStream::consumeFinishedScheduledThreadTaskEntries()
{
- std::vector< ZipOutputEntry* > aNonFinishedEntries;
+ std::vector< ZipOutputEntryInThread* > aNonFinishedEntries;
- for(ZipOutputEntry* pEntry : m_aEntries)
+ for(ZipOutputEntryInThread* pEntry : m_aEntries)
{
if(pEntry->isFinished())
{
- consumeScheduledThreadTaskEntry(std::unique_ptr<ZipOutputEntry>(pEntry));
+ consumeScheduledThreadTaskEntry(std::unique_ptr<ZipOutputEntryInThread>(pEntry));
}
else
{
@@ -167,9 +167,9 @@ void ZipOutputStream::finish()
// consume all processed entries
while(!m_aEntries.empty())
{
- ZipOutputEntry* pCandidate = m_aEntries.back();
+ ZipOutputEntryInThread* pCandidate = m_aEntries.back();
m_aEntries.pop_back();
- consumeScheduledThreadTaskEntry(std::unique_ptr<ZipOutputEntry>(pCandidate));
+ consumeScheduledThreadTaskEntry(std::unique_ptr<ZipOutputEntryInThread>(pCandidate));
}
sal_Int32 nOffset= static_cast < sal_Int32 > (m_aChucker.GetPosition());