[Libreoffice-commits] core.git: sot/source

Caolán McNamara caolanm at redhat.com
Sun Jan 28 14:19:14 UTC 2018


 sot/source/sdstor/stgstrms.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit fdd41c995d1f719e92c6f083e780226114762f05
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Jan 27 19:38:12 2018 +0000

    ofz#5747 short->sal_Int32 like in StgDataStrm
    
    Change-Id: I254c00b1142d7187beabe5d18532efec036de494
    Reviewed-on: https://gerrit.libreoffice.org/48751
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index 00a1a53c4314..efa03cd14d20 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -1066,7 +1066,7 @@ sal_Int32 StgSmallStrm::Read( void* pBuf, sal_Int32 n )
     // small stream is likely to be < 64 KBytes.
     if( ( m_nPos + n ) > m_nSize )
         n = m_nSize - m_nPos;
-    short nDone = 0;
+    sal_Int32 nDone = 0;
     while( n )
     {
         short nBytes = m_nPageSize - m_nOffset;
@@ -1083,7 +1083,7 @@ sal_Int32 StgSmallStrm::Read( void* pBuf, sal_Int32 n )
                 break;
             // all reading through the stream
             short nRes = static_cast<short>(m_pData->Read( static_cast<sal_uInt8*>(pBuf) + nDone, nBytes ));
-            nDone = nDone + nRes;
+            nDone += nRes;
             m_nPos += nRes;
             n -= nRes;
             m_nOffset = m_nOffset + nRes;
@@ -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
     // small stream is likely to be < 64 KBytes.
-    short nDone = 0;
+    sal_Int32 nDone = 0;
     if( ( m_nPos + n ) > m_nSize )
     {
         sal_Int32 nOld = m_nPos;
@@ -1126,7 +1126,7 @@ sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n )
             if( !m_pData->Pos2Page( nDataPos ) )
                 break;
             short nRes = static_cast<short>(m_pData->Write( static_cast<sal_uInt8 const *>(pBuf) + nDone, nBytes ));
-            nDone = nDone + nRes;
+            nDone += nRes;
             m_nPos += nRes;
             n -= nRes;
             m_nOffset = m_nOffset + nRes;


More information about the Libreoffice-commits mailing list