diff options
author | Noel Grandin <noel@peralex.com> | 2016-03-04 13:41:22 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-03-04 14:01:19 +0200 |
commit | 1fd781e7cd33f325ec7e467ecd49e0cb6ff4762b (patch) | |
tree | 9ede2ca7b2f7336365f675d9388dafc2a1994be6 /oox/source/helper | |
parent | a4c17041271eca2181cf11e5a0b59f4001c20cee (diff) |
loplugin:unuseddefaultparam in oox/reportdesign/sd
Change-Id: Ia26cf182ddc7c903d86bf74a8175858adb88121c
Diffstat (limited to 'oox/source/helper')
-rw-r--r-- | oox/source/helper/binaryinputstream.cxx | 27 | ||||
-rw-r--r-- | oox/source/helper/binaryoutputstream.cxx | 10 |
2 files changed, 16 insertions, 21 deletions
diff --git a/oox/source/helper/binaryinputstream.cxx b/oox/source/helper/binaryinputstream.cxx index 7f35f6d3e280..5b5eb5b2d01c 100644 --- a/oox/source/helper/binaryinputstream.cxx +++ b/oox/source/helper/binaryinputstream.cxx @@ -102,23 +102,20 @@ OUString BinaryInputStream::readCompressedUnicodeArray( sal_Int32 nChars, bool b readUnicodeArray( nChars, bAllowNulChars ); } -void BinaryInputStream::copyToStream( BinaryOutputStream& rOutStrm, sal_Int64 nBytes ) +void BinaryInputStream::copyToStream( BinaryOutputStream& rOutStrm ) { - if( nBytes > 0 ) + sal_Int64 nBytes = SAL_MAX_INT64; + sal_Int32 nBufferSize = INPUTSTREAM_BUFFERSIZE; + StreamDataSequence aBuffer( nBufferSize ); + while( nBytes > 0 ) { - // make buffer size a multiple of the passed atom size - sal_Int32 nBufferSize = getLimitedValue< sal_Int32, sal_Int64 >( nBytes, 0, INPUTSTREAM_BUFFERSIZE ); - StreamDataSequence aBuffer( nBufferSize ); - while( nBytes > 0 ) - { - sal_Int32 nReadSize = getLimitedValue< sal_Int32, sal_Int64 >( nBytes, 0, nBufferSize ); - sal_Int32 nBytesRead = readData( aBuffer, nReadSize ); - rOutStrm.writeData( aBuffer ); - if( nReadSize == nBytesRead ) - nBytes -= nReadSize; - else - nBytes = 0; - } + sal_Int32 nReadSize = getLimitedValue< sal_Int32, sal_Int64 >( nBytes, 0, nBufferSize ); + sal_Int32 nBytesRead = readData( aBuffer, nReadSize ); + rOutStrm.writeData( aBuffer ); + if( nReadSize == nBytesRead ) + nBytes -= nReadSize; + else + nBytes = 0; } } diff --git a/oox/source/helper/binaryoutputstream.cxx b/oox/source/helper/binaryoutputstream.cxx index c35f15bc1834..c6d0f50f6749 100644 --- a/oox/source/helper/binaryoutputstream.cxx +++ b/oox/source/helper/binaryoutputstream.cxx @@ -99,20 +99,18 @@ void BinaryXOutputStream::writeMemory( const void* pMem, sal_Int32 nBytes, size_ } void -BinaryOutputStream::writeCharArrayUC( const OUString& rString, rtl_TextEncoding eTextEnc, bool bAllowNulChars ) +BinaryOutputStream::writeCharArrayUC( const OUString& rString, rtl_TextEncoding eTextEnc ) { OString sBuf( OUStringToOString( rString, eTextEnc ) ); - if( !bAllowNulChars ) - sBuf = sBuf.replace( '\0', '?' ); + sBuf = sBuf.replace( '\0', '?' ); writeMemory( static_cast< const void* >( sBuf.getStr() ), sBuf.getLength() ); } void -BinaryOutputStream::writeUnicodeArray( const OUString& rString, bool bAllowNulChars ) +BinaryOutputStream::writeUnicodeArray( const OUString& rString ) { OUString sBuf( rString ); - if( !bAllowNulChars ) - sBuf = sBuf.replace( '\0', '?' ); + sBuf = sBuf.replace( '\0', '?' ); #ifdef OSL_BIGENDIAN // need a non-const buffer for swapping byte order sal_Unicode notConst[sBuf.getLength()]; |