diff options
Diffstat (limited to 'sc/source/filter/excel/xestream.cxx')
-rw-r--r-- | sc/source/filter/excel/xestream.cxx | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 9c4d1c22fc76..7d08fb84ec70 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -99,7 +99,7 @@ XclExpStream::~XclExpStream() mrStrm.Flush(); } -void XclExpStream::StartRecord( sal_uInt16 nRecId, sal_Size nRecSize ) +void XclExpStream::StartRecord( sal_uInt16 nRecId, std::size_t nRecSize ) { OSL_ENSURE( !mbInRec, "XclExpStream::StartRecord - another record still open" ); DisableEncryption(); @@ -206,21 +206,21 @@ XclExpStream& XclExpStream::operator<<( double fValue ) return *this; } -sal_Size XclExpStream::Write( const void* pData, sal_Size nBytes ) +std::size_t XclExpStream::Write( const void* pData, std::size_t nBytes ) { - sal_Size nRet = 0; + std::size_t nRet = 0; if( pData && (nBytes > 0) ) { if( mbInRec ) { const sal_uInt8* pBuffer = static_cast< const sal_uInt8* >( pData ); - sal_Size nBytesLeft = nBytes; + std::size_t nBytesLeft = nBytes; bool bValid = true; while( bValid && (nBytesLeft > 0) ) { - sal_Size nWriteLen = ::std::min< sal_Size >( PrepareWrite(), nBytesLeft ); - sal_Size nWriteRet = nWriteLen; + std::size_t nWriteLen = ::std::min< std::size_t >( PrepareWrite(), nBytesLeft ); + std::size_t nWriteRet = nWriteLen; if (mbUseEncrypter && HasValidEncrypter()) { OSL_ENSURE(nWriteLen > 0, "XclExpStream::Write: write length is 0!"); @@ -247,14 +247,14 @@ sal_Size XclExpStream::Write( const void* pData, sal_Size nBytes ) return nRet; } -void XclExpStream::WriteZeroBytes( sal_Size nBytes ) +void XclExpStream::WriteZeroBytes( std::size_t nBytes ) { if( mbInRec ) { - sal_Size nBytesLeft = nBytes; + std::size_t nBytesLeft = nBytes; while( nBytesLeft > 0 ) { - sal_Size nWriteLen = ::std::min< sal_Size >( PrepareWrite(), nBytesLeft ); + std::size_t nWriteLen = ::std::min< std::size_t >( PrepareWrite(), nBytesLeft ); WriteRawZeroBytes( nWriteLen ); nBytesLeft -= nWriteLen; UpdateSizeVars( nWriteLen ); @@ -264,14 +264,14 @@ void XclExpStream::WriteZeroBytes( sal_Size nBytes ) WriteRawZeroBytes( nBytes ); } -void XclExpStream::WriteZeroBytesToRecord( sal_Size nBytes ) +void XclExpStream::WriteZeroBytesToRecord( std::size_t nBytes ) { if (!mbInRec) // not in record. return; sal_uInt8 nZero = 0; - for (sal_Size i = 0; i < nBytes; ++i) + for (std::size_t i = 0; i < nBytes; ++i) *this << nZero; } @@ -281,16 +281,16 @@ void XclExpStream::CopyFromStream(SvStream& rInStrm, sal_uInt64 const nBytes) sal_uInt64 nBytesLeft = ::std::min(nBytes, nRemaining); if( nBytesLeft > 0 ) { - const sal_Size nMaxBuffer = 4096; + const std::size_t nMaxBuffer = 4096; std::unique_ptr<sal_uInt8[]> pBuffer( - new sal_uInt8[ ::std::min<sal_Size>(nBytesLeft, nMaxBuffer) ]); + new sal_uInt8[ ::std::min<std::size_t>(nBytesLeft, nMaxBuffer) ]); bool bValid = true; while( bValid && (nBytesLeft > 0) ) { - sal_Size nWriteLen = ::std::min<sal_Size>(nBytesLeft, nMaxBuffer); + std::size_t nWriteLen = ::std::min<std::size_t>(nBytesLeft, nMaxBuffer); rInStrm.ReadBytes(pBuffer.get(), nWriteLen); - sal_Size nWriteRet = Write( pBuffer.get(), nWriteLen ); + std::size_t nWriteRet = Write( pBuffer.get(), nWriteLen ); bValid = (nWriteLen == nWriteRet); nBytesLeft -= nWriteRet; } @@ -324,8 +324,8 @@ void XclExpStream::WriteUnicodeBuffer( const ScfUInt16Vec& rBuffer, sal_uInt8 nF void XclExpStream::WriteByteString( const OString& rString ) { SetSliceSize( 0 ); - sal_Size nLen = ::std::min< sal_Size >( rString.getLength(), 0x00FF ); - nLen = ::std::min< sal_Size >( nLen, 0xFF ); + std::size_t nLen = ::std::min< std::size_t >( rString.getLength(), 0x00FF ); + nLen = ::std::min< std::size_t >( nLen, 0xFF ); sal_uInt16 nLeft = PrepareWrite(); if( mbInRec && (nLeft <= 1) ) @@ -375,7 +375,7 @@ void XclExpStream::InitRecord( sal_uInt16 nRecId ) mrStrm.WriteUInt16( nRecId ); mnLastSizePos = mrStrm.Tell(); - mnHeaderSize = static_cast< sal_uInt16 >( ::std::min< sal_Size >( mnPredictSize, mnCurrMaxSize ) ); + mnHeaderSize = static_cast< sal_uInt16 >( ::std::min< std::size_t >( mnPredictSize, mnCurrMaxSize ) ); mrStrm.WriteUInt16( mnHeaderSize ); mnCurrSize = mnSliceSize = 0; } @@ -389,7 +389,7 @@ void XclExpStream::UpdateRecSize() } } -void XclExpStream::UpdateSizeVars( sal_Size nSize ) +void XclExpStream::UpdateSizeVars( std::size_t nSize ) { OSL_ENSURE( mnCurrSize + nSize <= mnCurrMaxSize, "XclExpStream::UpdateSizeVars - record overwritten" ); mnCurrSize = mnCurrSize + static_cast< sal_uInt16 >( nSize ); @@ -437,10 +437,10 @@ sal_uInt16 XclExpStream::PrepareWrite() return nRet; } -void XclExpStream::WriteRawZeroBytes( sal_Size nBytes ) +void XclExpStream::WriteRawZeroBytes( std::size_t nBytes ) { const sal_uInt32 nData = 0; - sal_Size nBytesLeft = nBytes; + std::size_t nBytesLeft = nBytes; while( nBytesLeft >= sizeof( nData ) ) { mrStrm.WriteUInt32( nData ); @@ -565,12 +565,12 @@ void XclExpBiff8Encrypter::Init( const Sequence< NamedValue >& rEncryptionData ) } } -sal_uInt32 XclExpBiff8Encrypter::GetBlockPos( sal_Size nStrmPos ) +sal_uInt32 XclExpBiff8Encrypter::GetBlockPos( std::size_t nStrmPos ) { return static_cast< sal_uInt32 >( nStrmPos / EXC_ENCR_BLOCKSIZE ); } -sal_uInt16 XclExpBiff8Encrypter::GetOffsetInBlock( sal_Size nStrmPos ) +sal_uInt16 XclExpBiff8Encrypter::GetOffsetInBlock( std::size_t nStrmPos ) { return static_cast< sal_uInt16 >( nStrmPos % EXC_ENCR_BLOCKSIZE ); } @@ -623,7 +623,7 @@ void XclExpBiff8Encrypter::EncryptBytes( SvStream& rStrm, vector<sal_uInt8>& aBy OSL_ENSURE(bRet, "XclExpBiff8Encrypter::EncryptBytes: encryption failed!!"); (void) bRet; // to remove a silly compiler warning. - sal_Size nRet = rStrm.WriteBytes(&aBytes[nPos], nEncBytes); + std::size_t nRet = rStrm.WriteBytes(&aBytes[nPos], nEncBytes); OSL_ENSURE(nRet == nEncBytes, "XclExpBiff8Encrypter::EncryptBytes: fail to write to stream!!"); (void) nRet; // to remove a silly compiler warning. |