Kaydet (Commit) fdd41c99 authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#5747 short->sal_Int32 like in StgDataStrm

Change-Id: I254c00b1142d7187beabe5d18532efec036de494
Reviewed-on: https://gerrit.libreoffice.org/48751Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst b74750a9
...@@ -1066,7 +1066,7 @@ sal_Int32 StgSmallStrm::Read( void* pBuf, sal_Int32 n ) ...@@ -1066,7 +1066,7 @@ sal_Int32 StgSmallStrm::Read( void* pBuf, sal_Int32 n )
// small stream is likely to be < 64 KBytes. // small stream is likely to be < 64 KBytes.
if( ( m_nPos + n ) > m_nSize ) if( ( m_nPos + n ) > m_nSize )
n = m_nSize - m_nPos; n = m_nSize - m_nPos;
short nDone = 0; sal_Int32 nDone = 0;
while( n ) while( n )
{ {
short nBytes = m_nPageSize - m_nOffset; short nBytes = m_nPageSize - m_nOffset;
...@@ -1083,7 +1083,7 @@ sal_Int32 StgSmallStrm::Read( void* pBuf, sal_Int32 n ) ...@@ -1083,7 +1083,7 @@ sal_Int32 StgSmallStrm::Read( void* pBuf, sal_Int32 n )
break; break;
// all reading through the stream // all reading through the stream
short nRes = static_cast<short>(m_pData->Read( static_cast<sal_uInt8*>(pBuf) + nDone, nBytes )); short nRes = static_cast<short>(m_pData->Read( static_cast<sal_uInt8*>(pBuf) + nDone, nBytes ));
nDone = nDone + nRes; nDone += nRes;
m_nPos += nRes; m_nPos += nRes;
n -= nRes; n -= nRes;
m_nOffset = m_nOffset + nRes; m_nOffset = m_nOffset + nRes;
...@@ -1102,7 +1102,7 @@ sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n ) ...@@ -1102,7 +1102,7 @@ sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n )
{ {
// you can safely assume that reads are not huge, since the // you can safely assume that reads are not huge, since the
// small stream is likely to be < 64 KBytes. // small stream is likely to be < 64 KBytes.
short nDone = 0; sal_Int32 nDone = 0;
if( ( m_nPos + n ) > m_nSize ) if( ( m_nPos + n ) > m_nSize )
{ {
sal_Int32 nOld = m_nPos; sal_Int32 nOld = m_nPos;
...@@ -1126,7 +1126,7 @@ sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n ) ...@@ -1126,7 +1126,7 @@ sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n )
if( !m_pData->Pos2Page( nDataPos ) ) if( !m_pData->Pos2Page( nDataPos ) )
break; break;
short nRes = static_cast<short>(m_pData->Write( static_cast<sal_uInt8 const *>(pBuf) + nDone, nBytes )); short nRes = static_cast<short>(m_pData->Write( static_cast<sal_uInt8 const *>(pBuf) + nDone, nBytes ));
nDone = nDone + nRes; nDone += nRes;
m_nPos += nRes; m_nPos += nRes;
n -= nRes; n -= nRes;
m_nOffset = m_nOffset + nRes; m_nOffset = m_nOffset + nRes;
......
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