summaryrefslogtreecommitdiff
path: root/oox/source/helper/binaryinputstream.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-03-04 13:41:22 +0200
committerNoel Grandin <noel@peralex.com>2016-03-04 14:01:19 +0200
commit1fd781e7cd33f325ec7e467ecd49e0cb6ff4762b (patch)
tree9ede2ca7b2f7336365f675d9388dafc2a1994be6 /oox/source/helper/binaryinputstream.cxx
parenta4c17041271eca2181cf11e5a0b59f4001c20cee (diff)
loplugin:unuseddefaultparam in oox/reportdesign/sd
Change-Id: Ia26cf182ddc7c903d86bf74a8175858adb88121c
Diffstat (limited to 'oox/source/helper/binaryinputstream.cxx')
-rw-r--r--oox/source/helper/binaryinputstream.cxx27
1 files changed, 12 insertions, 15 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;
}
}