summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2015-10-27 18:25:07 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2015-10-27 18:54:02 +0100
commit51bc0594f2d65630cf167a107f3be3f79993e6d9 (patch)
treeb0f6e3eb02f46e5d1c0b55190ba6be1c8179bbc6 /sot
parent589934317239e46235d9cc53554f877d332fa777 (diff)
sal_uLong to sal_uInt64/sal_Size
Change-Id: I4032b08225f1b530a43f1a8c09c5fc3515f45ced
Diffstat (limited to 'sot')
-rw-r--r--sot/source/sdstor/stgstrms.cxx22
-rw-r--r--sot/source/sdstor/stgstrms.hxx2
2 files changed, 11 insertions, 13 deletions
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index f21bc25b9ae3..4367fc743b8b 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -1111,7 +1111,7 @@ sal_Int32 StgSmallStrm::Write( const void* pBuf, sal_Int32 n )
#define THRESHOLD 32768L
-StgTmpStrm::StgTmpStrm( sal_uLong nInitSize )
+StgTmpStrm::StgTmpStrm( sal_uInt64 nInitSize )
: SvMemoryStream( nInitSize > THRESHOLD
? 16
: ( nInitSize ? nInitSize : 16 ), 4096 )
@@ -1125,8 +1125,8 @@ StgTmpStrm::StgTmpStrm( sal_uLong nInitSize )
bool StgTmpStrm::Copy( StgTmpStrm& rSrc )
{
- sal_uLong n = rSrc.GetSize();
- sal_uLong nCur = rSrc.Tell();
+ sal_uInt64 n = rSrc.GetSize();
+ const sal_uInt64 nCur = rSrc.Tell();
SetSize( n );
if( GetError() == SVSTREAM_OK )
{
@@ -1135,9 +1135,7 @@ bool StgTmpStrm::Copy( StgTmpStrm& rSrc )
Seek( 0L );
while( n )
{
- sal_uLong nn = n;
- if( nn > 4096 )
- nn = 4096;
+ const sal_uInt64 nn = std::min<sal_uInt64>(n, 4096);
if( rSrc.Read( p.get(), nn ) != nn )
break;
if( Write( p.get(), nn ) != nn )
@@ -1187,15 +1185,15 @@ void StgTmpStrm::SetSize(sal_uInt64 n)
{
m_aName = utl::TempFile(0, false).GetURL();
SvFileStream* s = new SvFileStream( m_aName, STREAM_READWRITE );
- sal_uLong nCur = Tell();
- sal_uLong i = nEndOfData;
+ const sal_uInt64 nCur = Tell();
+ sal_uInt64 i = nEndOfData;
std::unique_ptr<sal_uInt8[]> p(new sal_uInt8[ 4096 ]);
if( i )
{
Seek( 0L );
while( i )
{
- sal_uLong nb = ( i > 4096 ) ? 4096 : i;
+ const sal_uInt64 nb = std::min<sal_uInt64>(i, 4096);
if( Read( p.get(), nb ) == nb
&& s->Write( p.get(), nb ) == nb )
i -= nb;
@@ -1213,7 +1211,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n)
i = n - nEndOfData;
while (i)
{
- sal_uLong const nb = (i > 4096) ? 4096 : i;
+ const sal_uInt64 nb = std::min<sal_uInt64>(i, 4096);
if (s->Write(p.get(), nb) == nb)
i -= nb;
else
@@ -1247,7 +1245,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n)
}
}
-sal_uLong StgTmpStrm::GetData( void* pData, sal_uLong n )
+sal_Size StgTmpStrm::GetData( void* pData, sal_Size n )
{
if( m_pStrm )
{
@@ -1259,7 +1257,7 @@ sal_uLong StgTmpStrm::GetData( void* pData, sal_uLong n )
return SvMemoryStream::GetData( pData, n );
}
-sal_uLong StgTmpStrm::PutData( const void* pData, sal_uLong n )
+sal_Size StgTmpStrm::PutData( const void* pData, sal_Size n )
{
sal_uInt32 nCur = Tell();
sal_uInt32 nNew = nCur + n;
diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx
index 94f304963453..2ce3ff3f5b0e 100644
--- a/sot/source/sdstor/stgstrms.hxx
+++ b/sot/source/sdstor/stgstrms.hxx
@@ -151,7 +151,7 @@ class StgTmpStrm : public SvMemoryStream
virtual void FlushData() override;
public:
- explicit StgTmpStrm( sal_uLong=16 );
+ explicit StgTmpStrm( sal_uInt64=16 );
virtual ~StgTmpStrm();
bool Copy( StgTmpStrm& );
virtual void SetSize( sal_uInt64 ) override;