summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-03-29 01:19:24 +0100
committerMichael Stahl <mstahl@redhat.com>2014-03-29 02:03:07 +0100
commit1258b576aef2ff3cdd4f44e1c03edb8c862a79f6 (patch)
tree80bbe4b11f5f7149ee64d50ecd55eb15e79839df
parent19bbfc0b39d79a90539fd3094d9b6d7d81619a45 (diff)
tools: support 64-bit file positions in SvStream
Bump stream positions to 64 bits on: SvLockBytes::SetSize() SvStream::SeekPos() SvStream::SetSize() SvStream::SetStreamSize() SvStream::Seek() SvStream::SeekRel() SvStream::Tell() SvStream::remainingSize() SvStream::nActPos SvStream::nBufFilePos Change-Id: I0521fd60d31d1a33e5634cbf51dd42edc46ad919 TODO: adapt callers of Seek()/SeekRel()/Tell()/remainingSize()
-rw-r--r--forms/source/component/imgprod.cxx4
-rw-r--r--include/sot/storage.hxx6
-rw-r--r--include/svl/instrm.hxx4
-rw-r--r--include/svl/outstrm.hxx4
-rw-r--r--include/svl/strmadpt.hxx2
-rw-r--r--include/tools/pstm.hxx2
-rw-r--r--include/tools/stream.hxx32
-rw-r--r--include/unotools/ucblockbytes.hxx4
-rw-r--r--lotuswordpro/source/filter/bento.hxx4
-rw-r--r--lotuswordpro/source/filter/utbenvs.cxx4
-rw-r--r--sot/source/sdstor/stgole.cxx2
-rw-r--r--sot/source/sdstor/stgstrms.cxx6
-rw-r--r--sot/source/sdstor/storage.cxx8
-rw-r--r--sot/source/sdstor/ucbstorage.cxx20
-rw-r--r--svl/source/misc/strmadpt.cxx10
-rw-r--r--tools/source/ref/pstm.cxx4
-rw-r--r--tools/source/stream/stream.cxx120
-rw-r--r--tools/source/stream/strmunx.cxx4
-rw-r--r--tools/source/stream/strmwnt.cxx6
-rw-r--r--unotools/source/ucbhelper/ucblockbytes.cxx2
20 files changed, 124 insertions, 124 deletions
diff --git a/forms/source/component/imgprod.cxx b/forms/source/component/imgprod.cxx
index 6af16453f153..47be5b238287 100644
--- a/forms/source/component/imgprod.cxx
+++ b/forms/source/component/imgprod.cxx
@@ -50,7 +50,7 @@ public:
virtual ErrCode ReadAt( sal_uInt64 nPos, void* pBuffer, sal_Size nCount, sal_Size * pRead ) const SAL_OVERRIDE;
virtual ErrCode WriteAt( sal_uInt64 nPos, const void* pBuffer, sal_Size nCount, sal_Size * pWritten ) SAL_OVERRIDE;
virtual ErrCode Flush() const SAL_OVERRIDE;
- virtual ErrCode SetSize( sal_Size nSize ) SAL_OVERRIDE;
+ virtual ErrCode SetSize( sal_uInt64 nSize ) SAL_OVERRIDE;
virtual ErrCode Stat( SvLockBytesStat*, SvLockBytesStatFlag ) const SAL_OVERRIDE;
};
@@ -145,7 +145,7 @@ ErrCode ImgProdLockBytes::Flush() const
-ErrCode ImgProdLockBytes::SetSize( sal_Size nSize )
+ErrCode ImgProdLockBytes::SetSize(sal_uInt64 const nSize)
{
if( GetStream() )
return SvLockBytes::SetSize( nSize );
diff --git a/include/sot/storage.hxx b/include/sot/storage.hxx
index 2ce9bf565bb0..b0c5b4670733 100644
--- a/include/sot/storage.hxx
+++ b/include/sot/storage.hxx
@@ -56,7 +56,7 @@ friend class SotStorage;
protected:
virtual sal_uLong GetData( void* pData, sal_uLong nSize ) SAL_OVERRIDE;
virtual sal_uLong PutData( const void* pData, sal_uLong nSize ) SAL_OVERRIDE;
- virtual sal_uLong SeekPos( sal_uLong nPos ) SAL_OVERRIDE;
+ virtual sal_uInt64 SeekPos(sal_uInt64 nPos) SAL_OVERRIDE;
virtual void FlushData() SAL_OVERRIDE;
~SotStorageStream();
public:
@@ -77,13 +77,13 @@ public:
virtual void ResetError() SAL_OVERRIDE;
- virtual void SetSize( sal_uLong nNewSize ) SAL_OVERRIDE;
+ virtual void SetSize( sal_uInt64 nNewSize ) SAL_OVERRIDE;
sal_uInt32 GetSize() const;
bool CopyTo( SotStorageStream * pDestStm );
virtual bool Commit();
virtual bool Revert();
bool SetProperty( const OUString& rName, const ::com::sun::star::uno::Any& rValue );
- virtual sal_Size remainingSize() SAL_OVERRIDE;
+ virtual sal_uInt64 remainingSize() SAL_OVERRIDE;
};
#ifndef SOT_DECL_SOTSTORAGESTREAM_DEFINED
diff --git a/include/svl/instrm.hxx b/include/svl/instrm.hxx
index 149b0f74059a..441238f1382e 100644
--- a/include/svl/instrm.hxx
+++ b/include/svl/instrm.hxx
@@ -47,11 +47,11 @@ class SVL_DLLPUBLIC SvInputStream: public SvStream
SVL_DLLPRIVATE virtual sal_uLong PutData(void const *, sal_uLong) SAL_OVERRIDE;
- SVL_DLLPRIVATE virtual sal_uLong SeekPos(sal_uLong nPos) SAL_OVERRIDE;
+ SVL_DLLPRIVATE virtual sal_uInt64 SeekPos(sal_uInt64 nPos) SAL_OVERRIDE;
SVL_DLLPRIVATE virtual void FlushData() SAL_OVERRIDE;
- SVL_DLLPRIVATE virtual void SetSize(sal_uLong) SAL_OVERRIDE;
+ SVL_DLLPRIVATE virtual void SetSize(sal_uInt64) SAL_OVERRIDE;
public:
SvInputStream(
diff --git a/include/svl/outstrm.hxx b/include/svl/outstrm.hxx
index 8ab49a6d1da3..a0bea052689b 100644
--- a/include/svl/outstrm.hxx
+++ b/include/svl/outstrm.hxx
@@ -38,11 +38,11 @@ class SVL_DLLPUBLIC SvOutputStream: public SvStream
SVL_DLLPRIVATE virtual sal_uLong PutData(void const * pData, sal_uLong nSize) SAL_OVERRIDE;
- SVL_DLLPRIVATE virtual sal_uLong SeekPos(sal_uLong) SAL_OVERRIDE;
+ SVL_DLLPRIVATE virtual sal_uInt64 SeekPos(sal_uInt64) SAL_OVERRIDE;
SVL_DLLPRIVATE virtual void FlushData() SAL_OVERRIDE;
- SVL_DLLPRIVATE virtual void SetSize(sal_uLong) SAL_OVERRIDE;
+ SVL_DLLPRIVATE virtual void SetSize(sal_uInt64) SAL_OVERRIDE;
public:
SvOutputStream(com::sun::star::uno::Reference<
diff --git a/include/svl/strmadpt.hxx b/include/svl/strmadpt.hxx
index 5f540566db92..872a8506cc3c 100644
--- a/include/svl/strmadpt.hxx
+++ b/include/svl/strmadpt.hxx
@@ -50,7 +50,7 @@ public:
virtual ErrCode Flush() const SAL_OVERRIDE;
- virtual ErrCode SetSize(sal_uLong) SAL_OVERRIDE;
+ virtual ErrCode SetSize(sal_uInt64) SAL_OVERRIDE;
virtual ErrCode Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const SAL_OVERRIDE;
diff --git a/include/tools/pstm.hxx b/include/tools/pstm.hxx
index f43603e8c6c4..cf42246cd9e9 100644
--- a/include/tools/pstm.hxx
+++ b/include/tools/pstm.hxx
@@ -197,7 +197,7 @@ class TOOLS_DLLPUBLIC SvPersistStream : public SvStream
virtual sal_uIntPtr GetData( void* pData, sal_uIntPtr nSize ) SAL_OVERRIDE;
virtual sal_uIntPtr PutData( const void* pData, sal_uIntPtr nSize ) SAL_OVERRIDE;
- virtual sal_uIntPtr SeekPos( sal_uIntPtr nPos ) SAL_OVERRIDE;
+ virtual sal_uInt64 SeekPos(sal_uInt64 nPos) SAL_OVERRIDE;
virtual void FlushData() SAL_OVERRIDE;
protected:
diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx
index 448b4811865d..7732d6dcb291 100644
--- a/include/tools/stream.hxx
+++ b/include/tools/stream.hxx
@@ -70,7 +70,7 @@ typedef sal_uInt16 StreamMode;
#define STREAM_STD_READWRITE (STREAM_READWRITE | STREAM_SHARE_DENYALL)
#define STREAM_SEEK_TO_BEGIN 0L
-#define STREAM_SEEK_TO_END ULONG_MAX
+#define STREAM_SEEK_TO_END SAL_MAX_UINT64
#define NUMBERFORMAT_INT_BIGENDIAN (sal_uInt16)0x0000
#define NUMBERFORMAT_INT_LITTLEENDIAN (sal_uInt16)0xFFFF
@@ -136,7 +136,7 @@ public:
virtual ErrCode Flush() const;
- virtual ErrCode SetSize(sal_Size nSize);
+ virtual ErrCode SetSize(sal_uInt64 nSize);
virtual ErrCode Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const;
};
@@ -204,7 +204,7 @@ private:
// LockBytes Interface
void* pImp; // unused
SvLockBytesRef xLockBytes; // Default implementation
- sal_Size nActPos;
+ sal_uInt64 m_nActPos;
// Puffer-Verwaltung
sal_uInt8* pRWBuf; // Points to read/write buffer
@@ -244,15 +244,15 @@ private:
SvStream& operator=( const SvStream& rStream ); // not implemented
protected:
- sal_Size nBufFilePos;///< File position of pBuf[0]
+ sal_uInt64 m_nBufFilePos; ///< File position of pBuf[0]
sal_uInt16 eStreamMode;
bool bIsWritable;
virtual sal_Size GetData( void* pData, sal_Size nSize );
virtual sal_Size PutData( const void* pData, sal_Size nSize );
- virtual sal_Size SeekPos( sal_Size nPos );
+ virtual sal_uInt64 SeekPos( sal_uInt64 nPos );
virtual void FlushData();
- virtual void SetSize( sal_Size nSize );
+ virtual void SetSize(sal_uInt64 nSize);
void ClearError();
void ClearBuffer();
@@ -339,15 +339,15 @@ public:
sal_Size Read( void* pData, sal_Size nSize );
sal_Size Write( const void* pData, sal_Size nSize );
- sal_Size Seek( sal_Size nPos );
- sal_Size SeekRel( sal_sSize nPos );
- sal_Size Tell() const { return nBufFilePos+nBufActualPos; }
+ sal_uInt64 Seek( sal_uInt64 nPos );
+ sal_uInt64 SeekRel( sal_Int64 nPos );
+ sal_uInt64 Tell() const { return m_nBufFilePos + nBufActualPos; }
// length between current (Tell()) pos and end of stream
- virtual sal_Size remainingSize();
+ virtual sal_uInt64 remainingSize();
void Flush();
bool IsEof() const { return bIsEof; }
// next Tell() <= nSize
- bool SetStreamSize( sal_Size nSize );
+ bool SetStreamSize( sal_uInt64 nSize );
/** Read a line of bytes.
@@ -662,8 +662,8 @@ private:
protected:
virtual sal_Size GetData( void* pData, sal_Size nSize ) SAL_OVERRIDE;
virtual sal_Size PutData( const void* pData, sal_Size nSize ) SAL_OVERRIDE;
- virtual sal_Size SeekPos( sal_Size nPos ) SAL_OVERRIDE;
- virtual void SetSize( sal_Size nSize ) SAL_OVERRIDE;
+ virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) SAL_OVERRIDE;
+ virtual void SetSize( sal_uInt64 nSize ) SAL_OVERRIDE;
virtual void FlushData() SAL_OVERRIDE;
public:
@@ -703,8 +703,8 @@ protected:
virtual sal_Size GetData( void* pData, sal_Size nSize ) SAL_OVERRIDE;
virtual sal_Size PutData( const void* pData, sal_Size nSize ) SAL_OVERRIDE;
- virtual sal_Size SeekPos( sal_Size nPos ) SAL_OVERRIDE;
- virtual void SetSize( sal_Size nSize ) SAL_OVERRIDE;
+ virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) SAL_OVERRIDE;
+ virtual void SetSize( sal_uInt64 nSize ) SAL_OVERRIDE;
virtual void FlushData() SAL_OVERRIDE;
/// AllocateMemory must update pBuf accordingly
@@ -747,7 +747,7 @@ public:
bool IsObjectMemoryOwner() { return bOwnsData; }
void SetResizeOffset( sal_Size nNewResize ) { nResize = nNewResize; }
sal_Size GetResizeOffset() const { return nResize; }
- virtual sal_Size remainingSize() SAL_OVERRIDE { return GetBufSize() - Tell(); }
+ virtual sal_uInt64 remainingSize() SAL_OVERRIDE { return GetBufSize() - Tell(); }
};
class TOOLS_DLLPUBLIC SvScriptStream: public SvStream
diff --git a/include/unotools/ucblockbytes.hxx b/include/unotools/ucblockbytes.hxx
index 8bb15e77dc28..a8b854a1a1a1 100644
--- a/include/unotools/ucblockbytes.hxx
+++ b/include/unotools/ucblockbytes.hxx
@@ -134,8 +134,8 @@ public:
virtual void SetSynchronMode (bool bSynchron) SAL_OVERRIDE;
virtual ErrCode ReadAt(sal_uInt64 nPos, void *pBuffer, sal_uLong nCount, sal_uLong *pRead) const SAL_OVERRIDE;
virtual ErrCode WriteAt(sal_uInt64, const void*, sal_uLong, sal_uLong *pWritten) SAL_OVERRIDE;
- virtual ErrCode Flush (void) const SAL_OVERRIDE;
- virtual ErrCode SetSize (sal_uLong) SAL_OVERRIDE;
+ virtual ErrCode Flush() const SAL_OVERRIDE;
+ virtual ErrCode SetSize(sal_uInt64) SAL_OVERRIDE;
virtual ErrCode Stat ( SvLockBytesStat *pStat, SvLockBytesStatFlag) const SAL_OVERRIDE;
void SetError( ErrCode nError )
diff --git a/lotuswordpro/source/filter/bento.hxx b/lotuswordpro/source/filter/bento.hxx
index b27f95713fef..54d1925bf539 100644
--- a/lotuswordpro/source/filter/bento.hxx
+++ b/lotuswordpro/source/filter/bento.hxx
@@ -190,8 +190,8 @@ protected: // Overridden methods
virtual sal_uLong GetData( void* pData, sal_uLong nSize ) SAL_OVERRIDE;
virtual sal_uLong PutData( const void* pData, sal_uLong nSize ) SAL_OVERRIDE;
- virtual sal_uLong SeekPos( sal_uLong nPos ) SAL_OVERRIDE;
- virtual void SetSize( sal_uLong nSize ) SAL_OVERRIDE;
+ virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) SAL_OVERRIDE;
+ virtual void SetSize( sal_uInt64 nSize ) SAL_OVERRIDE;
virtual void FlushData() SAL_OVERRIDE;
private: // Data
diff --git a/lotuswordpro/source/filter/utbenvs.cxx b/lotuswordpro/source/filter/utbenvs.cxx
index 4bbc6b848656..ea67781276d5 100644
--- a/lotuswordpro/source/filter/utbenvs.cxx
+++ b/lotuswordpro/source/filter/utbenvs.cxx
@@ -97,7 +97,7 @@ sal_uLong LtcUtBenValueStream::PutData( const void* /*pData*/, sal_uLong nSize
* @param position in value stream
* @return current position in value stream
*/
- sal_uLong LtcUtBenValueStream::SeekPos( sal_uLong nPos )
+sal_uInt64 LtcUtBenValueStream::SeekPos(sal_uInt64 const nPos)
{
if (nPos <= m_ulValueLength)
cCurrentPosition = nPos;
@@ -111,7 +111,7 @@ sal_uLong LtcUtBenValueStream::PutData( const void* /*pData*/, sal_uLong nSize
* @param size of buffer
* @return
*/
- void LtcUtBenValueStream::SetSize( sal_uLong /*nSize*/ )
+ void LtcUtBenValueStream::SetSize( sal_uInt64 /*nSize*/ )
{
//pLtcBenContainer pContainer = cpValue->GetContainer();
//pContainer->GetStream()->SetStreamSize(nSize);
diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx
index 301899d0d0ae..0b9d0b564d2d 100644
--- a/sot/source/sdstor/stgole.cxx
+++ b/sot/source/sdstor/stgole.cxx
@@ -68,7 +68,7 @@ sal_uLong StgInternalStream::PutData( const void* pData, sal_uLong nSize )
return 0;
}
-sal_uLong StgInternalStream::SeekPos( sal_uLong nPos )
+sal_uInt64 StgInternalStream::SeekPos(sal_uInt64 const nPos)
{
return pStrm ? pStrm->Seek( nPos ) : 0;
}
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index f1d1fa22110a..680daf26afbd 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -1187,7 +1187,7 @@ sal_uLong StgTmpStrm::GetSize() const
return n;
}
-void StgTmpStrm::SetSize( sal_uLong n )
+void StgTmpStrm::SetSize(sal_uInt64 n)
{
if( pStrm )
pStrm->SetStreamSize( n );
@@ -1241,7 +1241,7 @@ void StgTmpStrm::SetSize( sal_uLong n )
{
if( n > nEndOfData )
{
- sal_uLong nCur = Tell();
+ sal_uInt64 nCur = Tell();
Seek( nEndOfData - 1 );
WriteUChar( (sal_uInt8) 0 );
Seek( nCur );
@@ -1284,7 +1284,7 @@ sal_uLong StgTmpStrm::PutData( const void* pData, sal_uLong n )
return nNew;
}
-sal_uLong StgTmpStrm::SeekPos( sal_uLong n )
+sal_uInt64 StgTmpStrm::SeekPos(sal_uInt64 n)
{
if( n == STREAM_SEEK_TO_END )
n = GetSize();
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index 5f18003b104a..217df328ee83 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -160,7 +160,7 @@ sal_uLong SotStorageStream::PutData( const void* pData, sal_uLong nSize )
return nRet;
}
-sal_uLong SotStorageStream::SeekPos( sal_uLong nPos )
+sal_uInt64 SotStorageStream::SeekPos(sal_uInt64 nPos)
{
sal_uLong nRet = 0;
@@ -186,9 +186,9 @@ void SotStorageStream::FlushData()
SvStream::FlushData();
}
-void SotStorageStream::SetSize( sal_uLong nNewSize )
+void SotStorageStream::SetSize(sal_uInt64 const nNewSize)
{
- sal_uLong nPos = Tell();
+ sal_uInt64 const nPos = Tell();
if( pOwnStm )
{
pOwnStm->SetSize( nNewSize );
@@ -211,7 +211,7 @@ sal_uInt32 SotStorageStream::GetSize() const
return nSize;
}
-sal_Size SotStorageStream::remainingSize()
+sal_uInt64 SotStorageStream::remainingSize()
{
if (pOwnStm)
return pOwnStm->GetSize() - Tell();
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 117c7322e3ee..a27239c50faf 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -407,8 +407,8 @@ public:
virtual sal_uLong GetData( void* pData, sal_uLong nSize ) SAL_OVERRIDE;
virtual sal_uLong PutData( const void* pData, sal_uLong nSize ) SAL_OVERRIDE;
- virtual sal_uLong SeekPos( sal_uLong nPos ) SAL_OVERRIDE;
- virtual void SetSize( sal_uLong nSize ) SAL_OVERRIDE;
+ virtual sal_uInt64 SeekPos( sal_uInt64 nPos ) SAL_OVERRIDE;
+ virtual void SetSize( sal_uInt64 nSize ) SAL_OVERRIDE;
virtual void FlushData() SAL_OVERRIDE;
virtual void ResetError() SAL_OVERRIDE;
@@ -447,7 +447,7 @@ public:
BaseStorage* CreateStorage();// create an OLE Storage on the UCBStorageStream
sal_uLong GetSize();
- sal_uLong ReadSourceWriteTemporary( sal_uLong aLength ); // read aLength from source and copy to temporary,
+ sal_uInt64 ReadSourceWriteTemporary( sal_uInt64 aLength ); // read aLength from source and copy to temporary,
// no seeking is produced
sal_uLong ReadSourceWriteTemporary(); // read source till the end and copy to temporary,
@@ -827,12 +827,12 @@ sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary()
}
-sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uLong aLength )
+sal_uInt64 UCBStorageStream_Impl::ReadSourceWriteTemporary(sal_uInt64 aLength)
{
// read aLength bite from the source stream and copy them to the current
// position of the temporary stream
- sal_uLong aResult = 0;
+ sal_uInt64 aResult = 0;
if( m_bSourceRead )
{
@@ -843,7 +843,7 @@ sal_uLong UCBStorageStream_Impl::ReadSourceWriteTemporary( sal_uLong aLength )
sal_uLong aReaded = 32000;
- for( sal_uLong pInd = 0; pInd < aLength && aReaded == 32000 ; pInd += 32000 )
+ for (sal_uInt64 pInd = 0; pInd < aLength && aReaded == 32000 ; pInd += 32000)
{
sal_uLong aToCopy = min( aLength - pInd, 32000 );
aReaded = m_rSource->readBytes( aData, aToCopy );
@@ -939,12 +939,12 @@ sal_uLong UCBStorageStream_Impl::PutData( const void* pData, sal_uLong nSize )
}
-sal_uLong UCBStorageStream_Impl::SeekPos( sal_uLong nPos )
+sal_uInt64 UCBStorageStream_Impl::SeekPos(sal_uInt64 const nPos)
{
if( !Init() )
return 0;
- sal_uLong aResult;
+ sal_uInt64 aResult;
if( nPos == STREAM_SEEK_TO_END )
{
@@ -996,7 +996,7 @@ sal_uLong UCBStorageStream_Impl::SeekPos( sal_uLong nPos )
return aResult;
}
-void UCBStorageStream_Impl::SetSize( sal_uLong nSize )
+void UCBStorageStream_Impl::SetSize(sal_uInt64 const nSize)
{
if ( !(m_nMode & STREAM_WRITE) )
{
@@ -1011,7 +1011,7 @@ void UCBStorageStream_Impl::SetSize( sal_uLong nSize )
if( m_bSourceRead )
{
- sal_uLong aPos = m_pStream->Tell();
+ sal_uInt64 const aPos = m_pStream->Tell();
m_pStream->Seek( STREAM_SEEK_TO_END );
if( m_pStream->Tell() < nSize )
ReadSourceWriteTemporary( nSize - m_pStream->Tell() );
diff --git a/svl/source/misc/strmadpt.cxx b/svl/source/misc/strmadpt.cxx
index 31d7275139f3..7746ec659ddb 100644
--- a/svl/source/misc/strmadpt.cxx
+++ b/svl/source/misc/strmadpt.cxx
@@ -170,7 +170,7 @@ ErrCode SvOutputStreamOpenLockBytes::Flush() const
}
// virtual
-ErrCode SvOutputStreamOpenLockBytes::SetSize(sal_uLong)
+ErrCode SvOutputStreamOpenLockBytes::SetSize(sal_uInt64)
{
return ERRCODE_IO_NOTSUPPORTED;
}
@@ -547,7 +547,7 @@ void SvInputStream::FlushData()
{}
// virtual
-sal_uLong SvInputStream::SeekPos(sal_uLong nPos)
+sal_uInt64 SvInputStream::SeekPos(sal_uInt64 const nPos)
{
if (open())
{
@@ -614,7 +614,7 @@ sal_uLong SvInputStream::SeekPos(sal_uLong nPos)
}
// virtual
-void SvInputStream::SetSize(sal_uLong)
+void SvInputStream::SetSize(sal_uInt64)
{
SetError(ERRCODE_IO_NOTSUPPORTED);
}
@@ -712,7 +712,7 @@ sal_uLong SvOutputStream::PutData(void const * pData, sal_uLong nSize)
}
// virtual
-sal_uLong SvOutputStream::SeekPos(sal_uLong)
+sal_uInt64 SvOutputStream::SeekPos(sal_uInt64)
{
SetError(ERRCODE_IO_NOTSUPPORTED);
return 0;
@@ -736,7 +736,7 @@ void SvOutputStream::FlushData()
}
// virtual
-void SvOutputStream::SetSize(sal_uLong)
+void SvOutputStream::SetSize(sal_uInt64)
{
SetError(ERRCODE_IO_NOTSUPPORTED);
}
diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx
index c9d172768186..eeab479bfa80 100644
--- a/tools/source/ref/pstm.cxx
+++ b/tools/source/ref/pstm.cxx
@@ -216,10 +216,10 @@ sal_uIntPtr SvPersistStream::PutData( const void* pData, sal_uIntPtr nSize )
return nRet;
}
-sal_uIntPtr SvPersistStream::SeekPos( sal_uIntPtr nPos )
+sal_uInt64 SvPersistStream::SeekPos(sal_uInt64 const nPos)
{
DBG_ASSERT( pStm, "stream not set" );
- sal_uIntPtr nRet = pStm->Seek( nPos );
+ sal_uInt64 nRet = pStm->Seek( nPos );
SetError( pStm->GetError() );
return nRet;
}
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index ea2e18678bbf..dcfc40c6672f 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -220,7 +220,7 @@ ErrCode SvLockBytes::Flush() const
}
// virtual
-ErrCode SvLockBytes::SetSize(sal_Size nSize)
+ErrCode SvLockBytes::SetSize(sal_uInt64 const nSize)
{
if (!m_pStream)
{
@@ -242,7 +242,7 @@ ErrCode SvLockBytes::Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const
if (pStat)
{
- sal_Size nPos = m_pStream->Tell();
+ sal_uInt64 const nPos = m_pStream->Tell();
pStat->nSize = m_pStream->Seek(STREAM_SEEK_TO_END);
m_pStream->Seek(nPos);
}
@@ -319,8 +319,8 @@ sal_Size SvStream::GetData( void* pData, sal_Size nSize )
{
DBG_ASSERT( xLockBytes.Is(), "pure virtual function" );
sal_Size nRet;
- nError = xLockBytes->ReadAt( nActPos, pData, nSize, &nRet );
- nActPos += nRet;
+ nError = xLockBytes->ReadAt(m_nActPos, pData, nSize, &nRet);
+ m_nActPos += nRet;
return nRet;
}
else return 0;
@@ -332,25 +332,25 @@ sal_Size SvStream::PutData( const void* pData, sal_Size nSize )
{
DBG_ASSERT( xLockBytes.Is(), "pure virtual function" );
sal_Size nRet;
- nError = xLockBytes->WriteAt( nActPos, pData, nSize, &nRet );
- nActPos += nRet;
+ nError = xLockBytes->WriteAt(m_nActPos, pData, nSize, &nRet);
+ m_nActPos += nRet;
return nRet;
}
else return 0;
}
-sal_Size SvStream::SeekPos( sal_Size nPos )
+sal_uInt64 SvStream::SeekPos(sal_uInt64 const nPos)
{
if( !GetError() && nPos == STREAM_SEEK_TO_END )
{
DBG_ASSERT( xLockBytes.Is(), "pure virtual function" );
SvLockBytesStat aStat;
xLockBytes->Stat( &aStat, SVSTATFLAG_DEFAULT );
- nActPos = aStat.nSize;
+ m_nActPos = aStat.nSize;
}
else
- nActPos = nPos;
- return nActPos;
+ m_nActPos = nPos;
+ return m_nActPos;
}
void SvStream::FlushData()
@@ -362,7 +362,7 @@ void SvStream::FlushData()
}
}
-void SvStream::SetSize( sal_Size nSize )
+void SvStream::SetSize(sal_uInt64 const nSize)
{
DBG_ASSERT( xLockBytes.Is(), "pure virtual function" );
nError = xLockBytes->SetSize( nSize );
@@ -370,7 +370,7 @@ void SvStream::SetSize( sal_Size nSize )
void SvStream::ImpInit()
{
- nActPos = 0;
+ m_nActPos = 0;
nCompressMode = COMPRESSMODE_NONE;
eStreamCharSet = osl_getThreadTextEncoding();
nCryptMask = 0;
@@ -383,7 +383,7 @@ void SvStream::ImpInit()
SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
- nBufFilePos = 0;
+ m_nBufFilePos = 0;
nBufActualPos = 0;
bIsDirty = false;
bIsConsistent = true;
@@ -463,7 +463,7 @@ void SvStream::SetNumberFormatInt( sal_uInt16 nNewFormat )
void SvStream::SetBufferSize( sal_uInt16 nBufferSize )
{
- sal_Size nActualFilePos = Tell();
+ sal_uInt64 const nActualFilePos = Tell();
bool bDontSeek = (pRWBuf == 0);
if( bIsDirty && bIsConsistent && bIsWritable ) // due to Windows NT: Access denied
@@ -472,7 +472,7 @@ void SvStream::SetBufferSize( sal_uInt16 nBufferSize )
if( nBufSize )
{
delete[] pRWBuf;
- nBufFilePos += nBufActualPos;
+ m_nBufFilePos += nBufActualPos;
}
pRWBuf = 0;
@@ -492,7 +492,7 @@ void SvStream::ClearBuffer()
{
nBufActualLen = 0;
nBufActualPos = 0;
- nBufFilePos = 0;
+ m_nBufFilePos = 0;
pBufPos = pRWBuf;
bIsDirty = false;
bIsConsistent = true;
@@ -519,7 +519,7 @@ bool SvStream::ReadLine( OString& rStr, sal_Int32 nMaxBytesToRead )
{
sal_Char buf[256+1];
bool bEnd = false;
- sal_Size nOldFilePos = Tell();
+ sal_uInt64 nOldFilePos = Tell();
sal_Char c = 0;
sal_Size nTotalLen = 0;
@@ -593,7 +593,7 @@ bool SvStream::ReadUniStringLine( OUString& rStr, sal_Int32 nMaxCodepointsToRead
{
sal_Unicode buf[256+1];
bool bEnd = false;
- sal_Size nOldFilePos = Tell();
+ sal_uInt64 nOldFilePos = Tell();
sal_Unicode c = 0;
sal_Size nTotalLen = 0;
@@ -690,7 +690,7 @@ OString read_zeroTerminated_uInt8s_ToOString(SvStream& rStream)
sal_Char buf[ 256 + 1 ];
bool bEnd = false;
- sal_Size nFilePos = rStream.Tell();
+ sal_uInt64 nFilePos = rStream.Tell();
while( !bEnd && !rStream.GetError() )
{
@@ -857,18 +857,18 @@ bool SvStream::StartReadingUnicodeText( rtl_TextEncoding eReadBomCharSet )
return nError == SVSTREAM_OK;
}
-sal_Size SvStream::SeekRel( sal_sSize nPos )
+sal_uInt64 SvStream::SeekRel(sal_Int64 const nPos)
{
- sal_Size nActualPos = Tell();
+ sal_uInt64 nActualPos = Tell();
if ( nPos >= 0 )
{
- if ( SAL_MAX_SIZE - nActualPos > (sal_Size)nPos )
+ if (SAL_MAX_UINT64 - nActualPos > static_cast<sal_uInt64>(nPos))
nActualPos += nPos;
}
else
{
- sal_Size nAbsPos = (sal_Size)-nPos;
+ sal_uInt64 const nAbsPos = static_cast<sal_uInt64>(-nPos);
if ( nActualPos >= nAbsPos )
nActualPos -= nAbsPos;
}
@@ -1262,7 +1262,7 @@ sal_Size SvStream::Read( void* pData, sal_Size nCount )
nCount = GetData( (char*)pData,nCount);
if( nCryptMask )
EncryptBuffer(pData, nCount);
- nBufFilePos += nCount;
+ m_nBufFilePos += nCount;
}
else
{
@@ -1281,7 +1281,7 @@ sal_Size SvStream::Read( void* pData, sal_Size nCount )
{
if( bIsDirty ) // Does stream require a flush?
{
- SeekPos( nBufFilePos );
+ SeekPos(m_nBufFilePos);
if( nCryptMask )
CryptAndWriteBuffer(pRWBuf, nBufActualLen);
else
@@ -1297,22 +1297,22 @@ sal_Size SvStream::Read( void* pData, sal_Size nCount )
bIoRead = false;
- SeekPos( nBufFilePos + nBufActualPos );
+ SeekPos(m_nBufFilePos + nBufActualPos);
nBufActualLen = 0;
pBufPos = pRWBuf;
nCount = GetData( (char*)pData, nCount );
if( nCryptMask )
EncryptBuffer(pData, nCount);
- nBufFilePos += nCount;
- nBufFilePos += nBufActualPos;
+ m_nBufFilePos += nCount;
+ m_nBufFilePos += nBufActualPos;
nBufActualPos = 0;
}
else
{
// => Yes. Fill buffer first, then copy to target area
- nBufFilePos += nBufActualPos;
- SeekPos( nBufFilePos );
+ m_nBufFilePos += nBufActualPos;
+ SeekPos(m_nBufFilePos);
// TODO: Typecast before GetData, sal_uInt16 nCountTmp
sal_Size nCountTmp = GetData( pRWBuf, nBufSize );
@@ -1356,7 +1356,7 @@ sal_Size SvStream::Write( const void* pData, sal_Size nCount )
nCount = CryptAndWriteBuffer( pData, nCount );
else
nCount = PutData( (char*)pData, nCount );
- nBufFilePos += nCount;
+ m_nBufFilePos += nCount;
return nCount;
}
@@ -1378,7 +1378,7 @@ sal_Size SvStream::Write( const void* pData, sal_Size nCount )
// Does stream require flushing?
if( bIsDirty )
{
- SeekPos( nBufFilePos );
+ SeekPos(m_nBufFilePos);
if( nCryptMask )
CryptAndWriteBuffer( pRWBuf, (sal_Size)nBufActualLen );
else
@@ -1390,16 +1390,16 @@ sal_Size SvStream::Write( const void* pData, sal_Size nCount )
if( nCount > nBufSize )
{
bIoWrite = false;
- nBufFilePos += nBufActualPos;
+ m_nBufFilePos += nBufActualPos;
nBufActualLen = 0;
nBufActualPos = 0;
pBufPos = pRWBuf;
- SeekPos( nBufFilePos );
+ SeekPos(m_nBufFilePos);
if( nCryptMask )
nCount = CryptAndWriteBuffer( pData, nCount );
else
nCount = PutData( (char*)pData, nCount );
- nBufFilePos += nCount;
+ m_nBufFilePos += nCount;
}
else
{
@@ -1407,7 +1407,7 @@ sal_Size SvStream::Write( const void* pData, sal_Size nCount )
memcpy( pRWBuf, pData, (size_t)nCount );
// Mind the order!
- nBufFilePos += nBufActualPos;
+ m_nBufFilePos += nBufActualPos;
nBufActualPos = (sal_uInt16)nCount;
pBufPos = pRWBuf + nCount;
nBufActualLen = (sal_uInt16)nCount;
@@ -1418,21 +1418,21 @@ sal_Size SvStream::Write( const void* pData, sal_Size nCount )
return nCount;
}
-sal_Size SvStream::Seek( sal_Size nFilePos )
+sal_uInt64 SvStream::Seek(sal_uInt64 const nFilePos)
{
bIoRead = bIoWrite = false;
bIsEof = false;
if( !pRWBuf )
{
- nBufFilePos = SeekPos( nFilePos );
- DBG_ASSERT(Tell()==nBufFilePos,"Out Of Sync!");
- return nBufFilePos;
+ m_nBufFilePos = SeekPos( nFilePos );
+ DBG_ASSERT(Tell() == m_nBufFilePos,"Out Of Sync!");
+ return m_nBufFilePos;
}
// Is seek position within buffer?
- if( nFilePos >= nBufFilePos && nFilePos <= (nBufFilePos + nBufActualLen))
+ if (nFilePos >= m_nBufFilePos && nFilePos <= (m_nBufFilePos + nBufActualLen))
{
- nBufActualPos = (sal_uInt16)(nFilePos - nBufFilePos);
+ nBufActualPos = (sal_uInt16)(nFilePos - m_nBufFilePos);
pBufPos = pRWBuf + nBufActualPos;
// Update nBufFree to avoid crash upon PutBack
nBufFree = nBufActualLen - nBufActualPos;
@@ -1441,7 +1441,7 @@ sal_Size SvStream::Seek( sal_Size nFilePos )
{
if( bIsDirty && bIsConsistent)
{
- SeekPos( nBufFilePos );
+ SeekPos(m_nBufFilePos);
if( nCryptMask )
CryptAndWriteBuffer( pRWBuf, nBufActualLen );
else
@@ -1451,25 +1451,25 @@ sal_Size SvStream::Seek( sal_Size nFilePos )
nBufActualLen = 0;
nBufActualPos = 0;
pBufPos = pRWBuf;
- nBufFilePos = SeekPos( nFilePos );
+ m_nBufFilePos = SeekPos( nFilePos );
}
#ifdef OV_DEBUG
{
- sal_Size nDebugTemp = nBufFilePos + nBufActualPos;
+ sal_uInt64 nDebugTemp = m_nBufFilePos + nBufActualPos;
DBG_ASSERT(Tell()==nDebugTemp,"Sync?");
}
#endif
- return nBufFilePos + nBufActualPos;
+ return m_nBufFilePos + nBufActualPos;
}
//STREAM_SEEK_TO_END in the some of the Seek backends is special cased to be
//efficient, in others e.g. SotStorageStream it's really horribly slow, and in
//those this should be overridden
-sal_Size SvStream::remainingSize()
+sal_uInt64 SvStream::remainingSize()
{
- sal_Size nCurr = Tell();
- sal_Size nEnd = Seek(STREAM_SEEK_TO_END);
- sal_Size nMaxAvailable = nEnd-nCurr;
+ sal_uInt64 const nCurr = Tell();
+ sal_uInt64 const nEnd = Seek(STREAM_SEEK_TO_END);
+ sal_uInt64 nMaxAvailable = nEnd-nCurr;
Seek(nCurr);
return nMaxAvailable;
}
@@ -1478,7 +1478,7 @@ void SvStream::Flush()
{
if( bIsDirty && bIsConsistent )
{
- SeekPos( nBufFilePos );
+ SeekPos(m_nBufFilePos);
if( nCryptMask )
CryptAndWriteBuffer( pRWBuf, (sal_Size)nBufActualLen );
else
@@ -1494,14 +1494,14 @@ void SvStream::RefreshBuffer()
{
if( bIsDirty && bIsConsistent )
{
- SeekPos( nBufFilePos );
+ SeekPos(m_nBufFilePos);
if( nCryptMask )
CryptAndWriteBuffer( pRWBuf, (sal_Size)nBufActualLen );
else
PutData( pRWBuf, nBufActualLen );
bIsDirty = false;
}
- SeekPos( nBufFilePos );
+ SeekPos(m_nBufFilePos);
nBufActualLen = (sal_uInt16)GetData( pRWBuf, nBufSize );
if( nBufActualLen && nError == ERRCODE_IO_PENDING )
nError = ERRCODE_NONE;
@@ -1621,7 +1621,7 @@ void SvStream::SetCryptMaskKey(const OString& rCryptMaskKey)
void SvStream::SyncSvStream( sal_Size nNewStreamPos )
{
ClearBuffer();
- SvStream::nBufFilePos = nNewStreamPos;
+ SvStream::m_nBufFilePos = nNewStreamPos;
}
void SvStream::SyncSysStream()
@@ -1630,10 +1630,10 @@ void SvStream::SyncSysStream()
SeekPos( Tell() );
}
-bool SvStream::SetStreamSize( sal_Size nSize )
+bool SvStream::SetStreamSize(sal_uInt64 const nSize)
{
#ifdef DBG_UTIL
- sal_Size nFPos = Tell();
+ sal_uInt64 nFPos = Tell();
#endif
sal_uInt16 nBuf = nBufSize;
SetBufferSize( 0 );
@@ -1740,8 +1740,8 @@ const void* SvMemoryStream::GetBuffer()
sal_uIntPtr SvMemoryStream::GetSize()
{
Flush();
- sal_uIntPtr nTemp = Tell();
- sal_uIntPtr nLength = Seek( STREAM_SEEK_TO_END );
+ sal_uInt64 const nTemp = Tell();
+ sal_uInt64 const nLength = Seek( STREAM_SEEK_TO_END );
Seek( nTemp );
return nLength;
}
@@ -1842,7 +1842,7 @@ sal_Size SvMemoryStream::PutData( const void* pData, sal_Size nCount )
return nCount;
}
-sal_Size SvMemoryStream::SeekPos( sal_Size nNewPos )
+sal_uInt64 SvMemoryStream::SeekPos(sal_uInt64 const nNewPos)
{
// nEndOfData: First position in stream not allowed to read from
// nSize: Size of allocated buffer
@@ -1975,7 +1975,7 @@ void* SvMemoryStream::SwitchBuffer( sal_Size nInitSize, sal_Size nResizeOffset)
return pRetVal;
}
-void SvMemoryStream::SetSize( sal_Size nNewSize )
+void SvMemoryStream::SetSize(sal_uInt64 const nNewSize)
{
long nDiff = (long)nNewSize - (long)nSize;
ReAllocateMemory( nDiff );
diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx
index 6cfbca57badf..9a937fec96f7 100644
--- a/tools/source/stream/strmunx.cxx
+++ b/tools/source/stream/strmunx.cxx
@@ -361,7 +361,7 @@ sal_Size SvFileStream::PutData( const void* pData, sal_Size nSize )
return (sal_Size)nWrite;
}
-sal_Size SvFileStream::SeekPos( sal_Size nPos )
+sal_uInt64 SvFileStream::SeekPos(sal_uInt64 const nPos)
{
if ( IsOpen() )
{
@@ -593,7 +593,7 @@ void SvFileStream::ResetError()
SvStream::ClearError();
}
-void SvFileStream::SetSize (sal_Size nSize)
+void SvFileStream::SetSize (sal_uInt64 const nSize)
{
if (IsOpen())
{
diff --git a/tools/source/stream/strmwnt.cxx b/tools/source/stream/strmwnt.cxx
index 9a6ce98c2128..29e0923043ab 100644
--- a/tools/source/stream/strmwnt.cxx
+++ b/tools/source/stream/strmwnt.cxx
@@ -165,7 +165,7 @@ sal_Size SvFileStream::PutData( const void* pData, sal_Size nSize )
return nCount;
}
-sal_Size SvFileStream::SeekPos( sal_Size nPos )
+sal_uInt64 SvFileStream::SeekPos(sal_uInt64 const nPos)
{
DWORD nNewPos = 0;
if( IsOpen() )
@@ -184,7 +184,7 @@ sal_Size SvFileStream::SeekPos( sal_Size nPos )
}
else
SetError( SVSTREAM_GENERALERROR );
- return (sal_Size)nNewPos;
+ return static_cast<sal_uInt64>(nNewPos);
}
void SvFileStream::FlushData()
@@ -410,7 +410,7 @@ void SvFileStream::ResetError()
SvStream::ClearError();
}
-void SvFileStream::SetSize( sal_Size nSize )
+void SvFileStream::SetSize(sal_uInt64 const nSize)
{
if( IsOpen() )
diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx
index 4d49bc177812..658581839992 100644
--- a/unotools/source/ucbhelper/ucblockbytes.cxx
+++ b/unotools/source/ucbhelper/ucblockbytes.cxx
@@ -1502,7 +1502,7 @@ ErrCode UcbLockBytes::Flush() const
}
-ErrCode UcbLockBytes::SetSize (sal_uLong nNewSize)
+ErrCode UcbLockBytes::SetSize (sal_uInt64 const nNewSize)
{
SvLockBytesStat aStat;
Stat( &aStat, (SvLockBytesStatFlag) 0 );