From dca61b588a2426cfe9a18e4a1074b380e42884d7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 8 Nov 2016 09:33:15 +0200 Subject: loplugin:expandablemethods in lotuswordpro..package Change-Id: Ic9827c998f4f78775fdf5c1eaf9d4749d4986102 Reviewed-on: https://gerrit.libreoffice.org/30682 Tested-by: Jenkins Reviewed-by: Noel Grandin --- package/inc/ZipOutputStream.hxx | 1 - package/inc/ZipPackageStream.hxx | 2 -- package/source/zipapi/ZipOutputStream.cxx | 17 ++++++----------- package/source/zippackage/ZipPackageStream.cxx | 17 ++++++----------- 4 files changed, 12 insertions(+), 25 deletions(-) (limited to 'package') diff --git a/package/inc/ZipOutputStream.hxx b/package/inc/ZipOutputStream.hxx index e532c3add02a..79fb84d47926 100644 --- a/package/inc/ZipOutputStream.hxx +++ b/package/inc/ZipOutputStream.hxx @@ -74,7 +74,6 @@ private: // ScheduledThread handling helpers void consumeScheduledThreadEntry(ZipOutputEntry* pCandidate); void consumeFinishedScheduledThreadEntries(); - void consumeAllScheduledThreadEntries(); public: void reduceScheduledThreadsToGivenNumberOrLess( diff --git a/package/inc/ZipPackageStream.hxx b/package/inc/ZipPackageStream.hxx index d6e1763e86af..605432ed169d 100644 --- a/package/inc/ZipPackageStream.hxx +++ b/package/inc/ZipPackageStream.hxx @@ -117,8 +117,6 @@ public: { m_xBaseEncryptionData->m_nIterationCount = nNewCount;} void setSize (const sal_Int64 nNewSize); - void CloseOwnStreamIfAny(); - ZipPackageStream( ZipPackage & rNewPackage, const css::uno::Reference < css::uno::XComponentContext >& xContext, sal_Int32 nFormat, diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx index 38039636b56d..603a61423eb4 100644 --- a/package/source/zipapi/ZipOutputStream.cxx +++ b/package/source/zipapi/ZipOutputStream.cxx @@ -148,16 +148,6 @@ void ZipOutputStream::consumeFinishedScheduledThreadEntries() m_aEntries = aNonFinishedEntries; } -void ZipOutputStream::consumeAllScheduledThreadEntries() -{ - while(!m_aEntries.empty()) - { - ZipOutputEntry* pCandidate = m_aEntries.back(); - m_aEntries.pop_back(); - consumeScheduledThreadEntry(pCandidate); - } -} - void ZipOutputStream::reduceScheduledThreadsToGivenNumberOrLess(sal_Int32 nThreads) { while(static_cast< sal_Int32 >(m_aEntries.size()) > nThreads) @@ -181,7 +171,12 @@ void ZipOutputStream::finish() comphelper::ThreadPool::getSharedOptimalPool().waitUntilDone(mpThreadTaskTag); // consume all processed entries - consumeAllScheduledThreadEntries(); + while(!m_aEntries.empty()) + { + ZipOutputEntry* pCandidate = m_aEntries.back(); + m_aEntries.pop_back(); + consumeScheduledThreadEntry(pCandidate); + } sal_Int32 nOffset= static_cast < sal_Int32 > (m_aChucker.GetPosition()); for (ZipEntry* p : m_aZipList) diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index 90fb399379b3..17a6fac66f6b 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -139,16 +139,6 @@ void ZipPackageStream::setZipEntryOnLoading( const ZipEntry &rInEntry ) m_bToBeCompressed = false; } -void ZipPackageStream::CloseOwnStreamIfAny() -{ - if ( m_xStream.is() ) - { - m_xStream->closeInput(); - m_xStream.clear(); - m_bHasSeekable = false; - } -} - uno::Reference< io::XInputStream > const & ZipPackageStream::GetOwnSeekStream() { if ( !m_bHasSeekable && m_xStream.is() ) @@ -905,7 +895,12 @@ void ZipPackageStream::successfullyWritten( ZipEntry *pEntry ) { if ( !IsPackageMember() ) { - CloseOwnStreamIfAny(); + if ( m_xStream.is() ) + { + m_xStream->closeInput(); + m_xStream.clear(); + m_bHasSeekable = false; + } SetPackageMember ( true ); } -- cgit