diff options
author | Mohammed Abdul Azeem <azeemmysore@gmail.com> | 2017-06-11 17:20:15 +0530 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2017-06-12 13:07:17 +0200 |
commit | 7260bb7160fe58ac63b6b5dd9a322805b1eacab4 (patch) | |
tree | 2d84736890bc7dd84d21419435f4a613de2243c0 /package | |
parent | febbad7263ea25b76f4e53d2f136693a52207a1c (diff) |
Setting Buffered(threaded)Stream as default:
Also cleaning up bUseBufferedStream parameter.
Change-Id: Ibf9c9fcefbdcd229ffaa1d3b169ff87f00e91ceb
Reviewed-on: https://gerrit.libreoffice.org/38661
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'package')
-rw-r--r-- | package/inc/ZipFile.hxx | 3 | ||||
-rw-r--r-- | package/qa/cppunit/test_package.cxx | 4 | ||||
-rw-r--r-- | package/source/xstor/xfactory.cxx | 3 | ||||
-rw-r--r-- | package/source/xstor/xstorage.cxx | 3 | ||||
-rw-r--r-- | package/source/zipapi/XUnbufferedStream.cxx | 3 | ||||
-rw-r--r-- | package/source/zipapi/ZipFile.cxx | 10 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 6 | ||||
-rw-r--r-- | package/source/zippackage/zipfileaccess.cxx | 6 |
8 files changed, 5 insertions, 33 deletions
diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx index 4aafaad77e6a..0362011e62d3 100644 --- a/package/inc/ZipFile.hxx +++ b/package/inc/ZipFile.hxx @@ -64,7 +64,6 @@ class ZipFile const css::uno::Reference < css::uno::XComponentContext > m_xContext; bool bRecoveryMode; - bool mbUseBufferedStream; // aMediaType parameter is used only for raw stream header creation css::uno::Reference < css::io::XInputStream > createStreamForZipEntry( @@ -105,8 +104,6 @@ public: EntryHash& GetEntryHash() { return aEntries; } - void setUseBufferedStream( bool b ); - void setInputStream ( const css::uno::Reference < css::io::XInputStream >& xNewStream ); css::uno::Reference< css::io::XInputStream > getRawData( ZipEntry& rEntry, diff --git a/package/qa/cppunit/test_package.cxx b/package/qa/cppunit/test_package.cxx index d4d533f67002..04e6b0643e96 100644 --- a/package/qa/cppunit/test_package.cxx +++ b/package/qa/cppunit/test_package.cxx @@ -53,11 +53,9 @@ namespace BootstrapFixtureBase::setUp(); OUString aURL = m_directories.getURLFromSrc("/package/qa/cppunit/data/a2z.zip"); - uno::Sequence<beans::NamedValue> aNVs(2); + uno::Sequence<beans::NamedValue> aNVs(1); aNVs[0].Name = "URL"; aNVs[0].Value <<= aURL; - aNVs[1].Name = "UseBufferedStream"; - aNVs[1].Value <<= true; uno::Sequence<uno::Any> aArgs(1); aArgs[0] <<= aNVs; diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx index bf73ca7525b4..24dcc03e5cb3 100644 --- a/package/source/xstor/xfactory.cxx +++ b/package/source/xstor/xfactory.cxx @@ -190,8 +190,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr if ( aDescr[nInd].Name == "InteractionHandler" || aDescr[nInd].Name == "Password" || aDescr[nInd].Name == "RepairPackage" - || aDescr[nInd].Name == "StatusIndicator" - || aDescr[nInd].Name == "UseBufferedStream" ) + || aDescr[nInd].Name == "StatusIndicator" ) { aPropsToSet.realloc( ++nNumArgs ); aPropsToSet[nNumArgs-1].Name = aDescr[nInd].Name; diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index db5ddcd8ba5a..58f30b9d29cf 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -431,8 +431,7 @@ void OStorage_Impl::OpenOwnPackage() for ( sal_Int32 aInd = 0; aInd < m_xProperties.getLength(); aInd++ ) { if ( m_xProperties[aInd].Name == "RepairPackage" - || m_xProperties[aInd].Name == "ProgressHandler" - || m_xProperties[aInd].Name == "UseBufferedStream" ) + || m_xProperties[aInd].Name == "ProgressHandler" ) { beans::NamedValue aNamedValue( m_xProperties[aInd].Name, m_xProperties[aInd].Value ); diff --git a/package/source/zipapi/XUnbufferedStream.cxx b/package/source/zipapi/XUnbufferedStream.cxx index a7465e397e24..bc905ddd64c6 100644 --- a/package/source/zipapi/XUnbufferedStream.cxx +++ b/package/source/zipapi/XUnbufferedStream.cxx @@ -309,7 +309,8 @@ void SAL_CALL XUnbufferedStream::skipBytes( sal_Int32 nBytesToSkip ) sal_Int32 SAL_CALL XUnbufferedStream::available( ) { - return static_cast < sal_Int32 > ( mnZipSize - mnMyCurrent ); + //available size must include the prepended header in case of wrapped raw stream + return static_cast < sal_Int32 > ( mnZipSize + mnHeaderToRead - mnMyCurrent ); } void SAL_CALL XUnbufferedStream::closeInput( ) diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index ddea09b3d824..8bb4a06764ff 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -81,7 +81,6 @@ ZipFile::ZipFile( const rtl::Reference<SotMutexHolder>& aMutexHolder, , xStream(xInput) , m_xContext ( rxContext ) , bRecoveryMode( false ) -, mbUseBufferedStream(false) { if (bInitialise) { @@ -103,7 +102,6 @@ ZipFile::ZipFile( const rtl::Reference<SotMutexHolder>& aMutexHolder, , xStream(xInput) , m_xContext ( rxContext ) , bRecoveryMode( bForceRecovery ) -, mbUseBufferedStream(false) { if (bInitialise) { @@ -124,11 +122,6 @@ ZipFile::~ZipFile() aEntries.clear(); } -void ZipFile::setUseBufferedStream( bool b ) -{ - mbUseBufferedStream = b; -} - void ZipFile::setInputStream ( const uno::Reference < XInputStream >& xNewStream ) { ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() ); @@ -623,9 +616,6 @@ uno::Reference< XInputStream > ZipFile::createStreamForZipEntry( uno::Reference<io::XInputStream> xSrcStream = new XUnbufferedStream( m_xContext, aMutexHolder, rEntry, xStream, rData, nStreamMode, bIsEncrypted, aMediaType, bRecoveryMode); - if (!mbUseBufferedStream) - return xSrcStream; - uno::Reference<io::XInputStream> xBufStream; static const sal_Int32 nThreadingThreshold = 10000; diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 61faad5600c1..f0837489bcc3 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -555,7 +555,6 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) if ( aArguments.getLength() ) { bool bHaveZipFile = true; - bool bUseBufferedStream = false; for( int ind = 0; ind < aArguments.getLength(); ind++ ) { @@ -683,10 +682,6 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) aNamedValue.Value >>= m_bAllowRemoveOnInsert; m_xRootFolder->setRemoveOnInsertMode_Impl( m_bAllowRemoveOnInsert ); } - else if (aNamedValue.Name == "UseBufferedStream") - { - aNamedValue.Value >>= bUseBufferedStream; - } // for now the progress handler is not used, probably it will never be // if ( aNamedValue.Name == "ProgressHandler" ) @@ -726,7 +721,6 @@ void SAL_CALL ZipPackage::initialize( const uno::Sequence< Any >& aArguments ) try { m_pZipFile = o3tl::make_unique<ZipFile>(m_aMutexHolder, m_xContentStream, m_xContext, true, m_bForceRecovery); - m_pZipFile->setUseBufferedStream(bUseBufferedStream); getZipFileContents(); } catch ( IOException & e ) diff --git a/package/source/zippackage/zipfileaccess.cxx b/package/source/zippackage/zipfileaccess.cxx index 7517e772caf2..5c8938cbefe6 100644 --- a/package/source/zippackage/zipfileaccess.cxx +++ b/package/source/zippackage/zipfileaccess.cxx @@ -183,8 +183,6 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu uno::Reference< io::XSeekable > xSeekable; uno::Sequence<beans::NamedValue> aArgs; - bool bUseBufferedStream = false; - auto openInputStream = [&]() { ::ucbhelper::Content aContent( @@ -222,8 +220,6 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu if (rArg.Name == "URL") rArg.Value >>= aParamURL; - else if (rArg.Name == "UseBufferedStream") - rArg.Value >>= bUseBufferedStream; } if (aParamURL.isEmpty()) @@ -251,8 +247,6 @@ void SAL_CALL OZipFileAccess::initialize( const uno::Sequence< uno::Any >& aArgu m_xContentStream, m_xContext, true ); - - m_pZipFile->setUseBufferedStream(bUseBufferedStream); } // XNameAccess |