[Libreoffice-commits] core.git: include/oox oox/source package/inc package/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Aug 13 06:35:37 UTC 2018


 include/oox/crypto/AgileEngine.hxx |    2 +-
 include/oox/ole/axbinarywriter.hxx |    4 ++--
 oox/source/crypto/AgileEngine.cxx  |    4 +---
 oox/source/ole/axbinarywriter.cxx  |    7 +++----
 package/inc/ZipFile.hxx            |    2 +-
 package/source/zipapi/ZipFile.cxx  |    4 +---
 6 files changed, 9 insertions(+), 14 deletions(-)

New commits:
commit 67649406d7b72f8d6ea4bbe76e775e0052ddefc3
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Sat Aug 11 13:55:03 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Aug 13 08:35:16 2018 +0200

    loplugin:returnconstant in oox,package
    
    Change-Id: I1dade7ddde6b1e226861d32f24f65be5bb9d9352
    Reviewed-on: https://gerrit.libreoffice.org/58880
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/oox/crypto/AgileEngine.hxx b/include/oox/crypto/AgileEngine.hxx
index 02f139bcfc11..40f9d7f6e3eb 100644
--- a/include/oox/crypto/AgileEngine.hxx
+++ b/include/oox/crypto/AgileEngine.hxx
@@ -108,7 +108,7 @@ public:
 
     // Decryption
 
-    bool decryptEncryptionKey(OUString const & rPassword);
+    void decryptEncryptionKey(OUString const & rPassword);
     bool decryptAndCheckVerifierHash(OUString const & rPassword);
 
     bool generateEncryptionKey(OUString const & rPassword) override;
diff --git a/include/oox/ole/axbinarywriter.hxx b/include/oox/ole/axbinarywriter.hxx
index c8b1bdb29158..000ca96e550e 100644
--- a/include/oox/ole/axbinarywriter.hxx
+++ b/include/oox/ole/axbinarywriter.hxx
@@ -86,7 +86,7 @@ public:
         respective flag in the property mask is set. */
     template< typename StreamType, typename DataType >
     void                writeIntProperty( DataType ornValue )
-                            { if( startNextProperty() ) maOutStrm.writeAligned< StreamType >( ornValue ); }
+                            { startNextProperty(); maOutStrm.writeAligned< StreamType >( ornValue ); }
     /** Write a boolean property value to the stream, the
         respective flag in the property mask is set. */
     void                writeBoolProperty( bool orbValue );
@@ -106,7 +106,7 @@ public:
 
 private:
     bool                ensureValid();
-    bool                startNextProperty( bool bSkip = false );
+    void                startNextProperty( bool bSkip = false );
 
 private:
     /** Base class for complex properties such as string, point, size, GUID, picture. */
diff --git a/oox/source/crypto/AgileEngine.cxx b/oox/source/crypto/AgileEngine.cxx
index 80c233d95655..54a8d952c66d 100644
--- a/oox/source/crypto/AgileEngine.cxx
+++ b/oox/source/crypto/AgileEngine.cxx
@@ -331,7 +331,7 @@ bool AgileEngine::decryptAndCheckVerifierHash(OUString const & rPassword)
     return (hash.size() <= hashValue.size() && std::equal(hash.begin(), hash.end(), hashValue.begin()));
 }
 
-bool AgileEngine::decryptEncryptionKey(OUString const & rPassword)
+void AgileEngine::decryptEncryptionKey(OUString const & rPassword)
 {
     sal_Int32 nKeySize = mInfo.keyBits / 8;
 
@@ -342,8 +342,6 @@ bool AgileEngine::decryptEncryptionKey(OUString const & rPassword)
     calculateHashFinal(rPassword, aPasswordHash);
 
     calculateBlock(constBlock3, aPasswordHash, mInfo.encryptedKeyValue, mKey);
-
-    return true;
 }
 
 // TODO: Rename
diff --git a/oox/source/ole/axbinarywriter.cxx b/oox/source/ole/axbinarywriter.cxx
index b532527923ab..d0e0c556e975 100644
--- a/oox/source/ole/axbinarywriter.cxx
+++ b/oox/source/ole/axbinarywriter.cxx
@@ -138,8 +138,8 @@ void AxBinaryPropertyWriter::writeBoolProperty( bool orbValue )
 
 void AxBinaryPropertyWriter::writePairProperty( AxPairData& orPairData )
 {
-    if( startNextProperty() )
-        maLargeProps.push_back( ComplexPropVector::value_type( new PairProperty( orPairData ) ) );
+    startNextProperty();
+    maLargeProps.push_back( ComplexPropVector::value_type( new PairProperty( orPairData ) ) );
 }
 
 void AxBinaryPropertyWriter::writeStringProperty( OUString& orValue )
@@ -198,12 +198,11 @@ bool AxBinaryPropertyWriter::ensureValid()
     return mbValid;
 }
 
-bool AxBinaryPropertyWriter::startNextProperty( bool bSkip )
+void AxBinaryPropertyWriter::startNextProperty( bool bSkip )
 {
     // if we are skipping then we clear the flag
     setFlag( mnPropFlags, mnNextProp, !bSkip );
     mnNextProp <<= 1;
-    return true;
 }
 
 } // namespace exp
diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx
index c5353b6c17d2..3dceb036c3bd 100644
--- a/package/inc/ZipFile.hxx
+++ b/package/inc/ZipFile.hxx
@@ -82,7 +82,7 @@ class ZipFile
 
     void getSizeAndCRC( sal_Int64 nOffset, sal_Int64 nCompressedSize, sal_Int64 *nSize, sal_Int32 *nCRC );
 
-    bool readLOC( ZipEntry &rEntry );
+    void readLOC( ZipEntry &rEntry );
     sal_Int32 readCEN();
     sal_Int32 findEND();
     void recover();
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index d2fa8a456392..27a89f27a1ba 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -755,7 +755,7 @@ uno::Reference< XInputStream > ZipFile::getWrappedRawStream(
     return createStreamForZipEntry ( aMutexHolder, rEntry, rData, UNBUFF_STREAM_WRAPPEDRAW, true, true, aMediaType );
 }
 
-bool ZipFile::readLOC( ZipEntry &rEntry )
+void ZipFile::readLOC( ZipEntry &rEntry )
 {
     ::osl::MutexGuard aGuard( m_aMutexHolder->GetMutex() );
 
@@ -821,8 +821,6 @@ bool ZipFile::readLOC( ZipEntry &rEntry )
 
     if ( bBroken && !bRecoveryMode )
         throw ZipIOException("The stream seems to be broken!" );
-
-    return true;
 }
 
 sal_Int32 ZipFile::findEND()


More information about the Libreoffice-commits mailing list