Kaydet (Commit) fd76aa7e authored tarafından Michael Stahl's avatar Michael Stahl

sc: adapt XclExpStream::CopyFromStream() to SvStream change

Change-Id: I58c183fe2b8e7b64ec0678e5eb136b9a467f1eb4
üst 8cc3ab84
...@@ -278,15 +278,14 @@ void XclExpStream::WriteZeroBytesToRecord( sal_Size nBytes ) ...@@ -278,15 +278,14 @@ void XclExpStream::WriteZeroBytesToRecord( sal_Size nBytes )
*this << nZero; *this << nZero;
} }
sal_Size XclExpStream::CopyFromStream( SvStream& rInStrm, sal_Size nBytes ) void XclExpStream::CopyFromStream(SvStream& rInStrm, sal_uInt64 const nBytes)
{ {
sal_Size nStrmPos = rInStrm.Tell(); sal_uInt64 const nStrmPos = rInStrm.Tell();
rInStrm.Seek( STREAM_SEEK_TO_END ); rInStrm.Seek( STREAM_SEEK_TO_END );
sal_Size nStrmSize = rInStrm.Tell(); sal_uInt64 const nStrmSize = rInStrm.Tell();
rInStrm.Seek( nStrmPos ); rInStrm.Seek( nStrmPos );
sal_Size nBytesLeft = ::std::min( nBytes, nStrmSize - nStrmPos ); sal_uInt64 nBytesLeft = ::std::min( nBytes, nStrmSize - nStrmPos );
sal_Size nRet = 0;
if( nBytesLeft > 0 ) if( nBytesLeft > 0 )
{ {
const sal_Size nMaxBuffer = 4096; const sal_Size nMaxBuffer = 4096;
...@@ -299,12 +298,10 @@ sal_Size XclExpStream::CopyFromStream( SvStream& rInStrm, sal_Size nBytes ) ...@@ -299,12 +298,10 @@ sal_Size XclExpStream::CopyFromStream( SvStream& rInStrm, sal_Size nBytes )
rInStrm.Read( pBuffer, nWriteLen ); rInStrm.Read( pBuffer, nWriteLen );
sal_Size nWriteRet = Write( pBuffer, nWriteLen ); sal_Size nWriteRet = Write( pBuffer, nWriteLen );
bValid = (nWriteLen == nWriteRet); bValid = (nWriteLen == nWriteRet);
nRet += nWriteRet;
nBytesLeft -= nWriteRet; nBytesLeft -= nWriteRet;
} }
delete[] pBuffer; delete[] pBuffer;
} }
return nRet;
} }
void XclExpStream::WriteUnicodeBuffer( const ScfUInt16Vec& rBuffer, sal_uInt8 nFlags ) void XclExpStream::WriteUnicodeBuffer( const ScfUInt16Vec& rBuffer, sal_uInt8 nFlags )
......
...@@ -122,7 +122,7 @@ public: ...@@ -122,7 +122,7 @@ public:
/** Copies nBytes bytes from current position of the stream rInStrm. /** Copies nBytes bytes from current position of the stream rInStrm.
@descr Omitting the second parameter means: read to end of stream. */ @descr Omitting the second parameter means: read to end of stream. */
sal_Size CopyFromStream( SvStream& rInStrm, sal_Size nBytes = STREAM_SEEK_TO_END ); void CopyFromStream( SvStream& rInStrm, sal_uInt64 nBytes = STREAM_SEEK_TO_END );
// *** unicode string export is realized with helper class XclExpString *** // *** unicode string export is realized with helper class XclExpString ***
// (slice length setting has no effect here -> disabled automatically) // (slice length setting has no effect here -> disabled automatically)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment