diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-25 18:20:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-26 08:56:47 +0200 |
commit | 979c8c56b7d52fe9a5d4b1fbfdab0adaba04c470 (patch) | |
tree | de5942b227fb6f441e1f36878a030a1b13601ba0 /package | |
parent | c2d139d8fa92e44baf592cd8ce644dc66356e143 (diff) |
loplugin:oncevar in oox..sax
Change-Id: I0fee8bcddaeea48335e3be05761d2ad2c45020e2
Reviewed-on: https://gerrit.libreoffice.org/39238
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'package')
-rw-r--r-- | package/source/xstor/xstorage.cxx | 5 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackage.cxx | 15 | ||||
-rw-r--r-- | package/source/zippackage/ZipPackageFolder.cxx | 4 |
3 files changed, 6 insertions, 18 deletions
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 5a06602448ca..89dae3f7bfdc 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -2622,9 +2622,6 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo( if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStorName == "_rels" ) throw lang::IllegalArgumentException( THROW_WHERE, uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name - // it's always possible to read written storage in this implementation - sal_Int32 nStorageMode = embed::ElementModes::READ; - try { SotElement_Impl *pElement = m_pImpl->FindElement( aStorName ); @@ -2639,7 +2636,7 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo( } if (!pElement->m_xStorage) - m_pImpl->OpenSubStorage( pElement, nStorageMode ); + m_pImpl->OpenSubStorage( pElement, embed::ElementModes::READ ); if (pElement->m_xStorage) { diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index f121a80b1c52..841d559af6d8 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -382,8 +382,6 @@ void ZipPackage::parseManifest() bool bODF12AndNewer = ( m_xRootFolder->GetVersion().compareTo( ODFVER_012_TEXT ) >= 0 ); if ( !m_bForceRecovery && bODF12AndNewer ) { - bool bDifferentStartKeyAlgorithm = false; - if ( m_bInconsistent ) { // this is an ODF1.2 document that contains streams not referred in the manifest.xml; @@ -392,13 +390,9 @@ void ZipPackage::parseManifest() throw ZipIOException( THROW_WHERE "there are streams not referred in manifest.xml" ); } - else if ( bDifferentStartKeyAlgorithm ) - { - // all the streams should be encrypted with the same StartKey in ODF1.2 - // TODO/LATER: in future the exception should be thrown - OSL_ENSURE( false, "ODF1.2 contains different StartKey Algorithms" ); - // throw ZipIOException( THROW_WHERE "More than one Start Key Generation algorithm is specified!" ); - } + // all the streams should be encrypted with the same StartKey in ODF1.2 + // TODO/LATER: in future the exception should be thrown + // throw ZipIOException( THROW_WHERE "More than one Start Key Generation algorithm is specified!" ); } // in case it is a correct ODF1.2 document, the version must be set @@ -1309,8 +1303,7 @@ uno::Reference< XActiveDataStreamer > ZipPackage::openOriginalForOutput() try { Exception aDetect; - sal_Int64 aSize = 0; - Any aAny = aOriginalContent.setPropertyValue("Size", makeAny( aSize ) ); + Any aAny = aOriginalContent.setPropertyValue("Size", makeAny( sal_Int64(0) ) ); if( !( aAny >>= aDetect ) ) bTruncSuccess = true; } diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx index ca09ef5a6288..8e7408aa9d81 100644 --- a/package/source/zippackage/ZipPackageFolder.cxx +++ b/package/source/zippackage/ZipPackageFolder.cxx @@ -263,8 +263,6 @@ bool ZipPackageFolder::saveChild( const uno::Sequence < sal_Int8 >& rEncryptionKey, const rtlRandomPool &rRandomPool) { - bool bSuccess = true; - const OUString sMediaTypeProperty ("MediaType"); const OUString sVersionProperty ("Version"); const OUString sFullPathProperty ("FullPath"); @@ -290,7 +288,7 @@ bool ZipPackageFolder::saveChild( if ( aPropSet.getLength() && ( m_nFormat == embed::StorageFormats::PACKAGE ) ) rManList.push_back( aPropSet ); - return bSuccess; + return true; } void ZipPackageFolder::saveContents( |