From 014b9ac2e4ec22a1eed2fde806edd7a840035a45 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 9 Jan 2017 10:35:25 +0200 Subject: loplugin:unusedmethods Change-Id: Ibe11923601760ded53a277c48631e4893606b2d6 Reviewed-on: https://gerrit.libreoffice.org/32875 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/source/filter/inc/biffcodec.hxx | 21 ----------------- sc/source/filter/oox/biffcodec.cxx | 47 -------------------------------------- 2 files changed, 68 deletions(-) (limited to 'sc') diff --git a/sc/source/filter/inc/biffcodec.hxx b/sc/source/filter/inc/biffcodec.hxx index 959fed5d8a32..fed33b878593 100644 --- a/sc/source/filter/inc/biffcodec.hxx +++ b/sc/source/filter/inc/biffcodec.hxx @@ -50,13 +50,6 @@ private: virtual css::uno::Sequence< css::beans::NamedValue > implVerifyPassword( const OUString& rPassword ) = 0; virtual bool implVerifyEncryptionData( const css::uno::Sequence< css::beans::NamedValue >& rEncryptionData ) = 0; - /** Implementation of decryption of a memory block. */ - virtual void implDecode( - sal_uInt8* pnDestData, - const sal_uInt8* pnSrcData, - sal_Int64 nStreamPos, - sal_uInt16 nBytes ) = 0; - private: bool mbValid; /// True = decoder is correctly initialized. }; @@ -74,13 +67,6 @@ private: virtual css::uno::Sequence< css::beans::NamedValue > implVerifyPassword( const OUString& rPassword ) override; virtual bool implVerifyEncryptionData( const css::uno::Sequence< css::beans::NamedValue >& rEncryptionData ) override; - /** Implementation of decryption of a memory block. */ - virtual void implDecode( - sal_uInt8* pnDestData, - const sal_uInt8* pnSrcData, - sal_Int64 nStreamPos, - sal_uInt16 nBytes ) override; - private: ::oox::core::BinaryCodec_XOR maCodec; /// Cipher algorithm implementation. css::uno::Sequence< css::beans::NamedValue > maEncryptionData; @@ -99,13 +85,6 @@ private: virtual css::uno::Sequence< css::beans::NamedValue > implVerifyPassword( const OUString& rPassword ) override; virtual bool implVerifyEncryptionData( const css::uno::Sequence< css::beans::NamedValue >& rEncryptionData ) override; - /** Implementation of decryption of a memory block. */ - virtual void implDecode( - sal_uInt8* pnDestData, - const sal_uInt8* pnSrcData, - sal_Int64 nStreamPos, - sal_uInt16 nBytes ) override; - private: ::oox::core::BinaryCodec_RCF maCodec; /// Cipher algorithm implementation. css::uno::Sequence< css::beans::NamedValue > maEncryptionData; diff --git a/sc/source/filter/oox/biffcodec.cxx b/sc/source/filter/oox/biffcodec.cxx index 705db2764982..4cfb84e19e08 100644 --- a/sc/source/filter/oox/biffcodec.cxx +++ b/sc/source/filter/oox/biffcodec.cxx @@ -99,28 +99,6 @@ bool BiffDecoder_XOR::implVerifyEncryptionData( const Sequence< NamedValue >& rE return maEncryptionData.hasElements(); } -void BiffDecoder_XOR::implDecode( sal_uInt8* pnDestData, const sal_uInt8* pnSrcData, sal_Int64 nStreamPos, sal_uInt16 nBytes ) -{ - maCodec.startBlock(); - maCodec.skip( static_cast< sal_Int32 >( (nStreamPos + nBytes) & 0x0F ) ); - maCodec.decode( pnDestData, pnSrcData, nBytes ); -} - -namespace { - -/** Returns the block index of the passed stream position for RCF decryption. */ -sal_Int32 lclGetRcfBlock( sal_Int64 nStreamPos ) -{ - return static_cast< sal_Int32 >( nStreamPos / BIFF_RCF_BLOCKSIZE ); -} - -/** Returns the offset of the passed stream position in a block for RCF decryption. */ -sal_Int32 lclGetRcfOffset( sal_Int64 nStreamPos ) -{ - return static_cast< sal_Int32 >( nStreamPos % BIFF_RCF_BLOCKSIZE ); -} - -} // namespace BiffDecoder_RCF::BiffDecoder_RCF( const BiffDecoder_RCF& rDecoder ) : BiffDecoderBase(), // must be called to prevent compiler warning @@ -173,31 +151,6 @@ bool BiffDecoder_RCF::implVerifyEncryptionData( const Sequence< NamedValue >& rE return maEncryptionData.hasElements(); } -void BiffDecoder_RCF::implDecode( sal_uInt8* pnDestData, const sal_uInt8* pnSrcData, sal_Int64 nStreamPos, sal_uInt16 nBytes ) -{ - sal_uInt8* pnCurrDest = pnDestData; - const sal_uInt8* pnCurrSrc = pnSrcData; - sal_Int64 nCurrPos = nStreamPos; - sal_uInt16 nBytesLeft = nBytes; - while( nBytesLeft > 0 ) - { - // initialize codec for current stream position - maCodec.startBlock( lclGetRcfBlock( nCurrPos ) ); - maCodec.skip( lclGetRcfOffset( nCurrPos ) ); - - // decode the block - sal_uInt16 nBlockLeft = static_cast< sal_uInt16 >( BIFF_RCF_BLOCKSIZE - lclGetRcfOffset( nCurrPos ) ); - sal_uInt16 nDecBytes = ::std::min( nBytesLeft, nBlockLeft ); - maCodec.decode( pnCurrDest, pnCurrSrc, static_cast< sal_Int32 >( nDecBytes ) ); - - // prepare for next block - pnCurrDest += nDecBytes; - pnCurrSrc += nDecBytes; - nCurrPos += nDecBytes; - nBytesLeft = nBytesLeft - nDecBytes; - } -} - } // namespace xls } // namespace oox -- cgit