diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-03-28 23:03:57 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-03-29 02:03:07 +0100 |
commit | 19bbfc0b39d79a90539fd3094d9b6d7d81619a45 (patch) | |
tree | ccac02c9c175f7254c08a108c5107d7f3ebed87f /unotools/source/streaming | |
parent | 655a39d8c0d151618d7c3b3fe0dcff508c2b53c5 (diff) |
tools: allow 64-bit positions on SvLockBytes
Bump stream positions to 64 bits on:
SvLockBytes::ReadAt()
SvLockBytes::WriteAt()
SvAsyncLockBytes::m_nSize
SvOpenLockBytes::Seek()
SvOpenLockBytes::Tell()
SvOutputStreamOpenLockBytes::m_nPosition
OInputStreamHelper::m_nActPos
Change-Id: Ica3b674e0ab23a756260a51475e97a5396ecdddb
Diffstat (limited to 'unotools/source/streaming')
-rw-r--r-- | unotools/source/streaming/streamhelper.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/unotools/source/streaming/streamhelper.cxx b/unotools/source/streaming/streamhelper.cxx index 519e6c7455ad..569d6e180dd0 100644 --- a/unotools/source/streaming/streamhelper.cxx +++ b/unotools/source/streaming/streamhelper.cxx @@ -47,10 +47,9 @@ sal_Int32 SAL_CALL OInputStreamHelper::readBytes(staruno::Sequence< sal_Int8 >& ::osl::MutexGuard aGuard( m_aMutex ); aData.realloc(nBytesToRead); - sal_Size nRead; + sal_Size nRead(0); ErrCode nError = m_xLockBytes->ReadAt(m_nActPos, (void*)aData.getArray(), nBytesToRead, &nRead); - // FIXME nRead could be truncated on 64-bit arches - m_nActPos += (sal_uInt32)nRead; + m_nActPos += nRead; if (nError != ERRCODE_NONE) throw stario::IOException(OUString(), static_cast<staruno::XWeak*>(this)); @@ -65,9 +64,7 @@ sal_Int32 SAL_CALL OInputStreamHelper::readBytes(staruno::Sequence< sal_Int8 >& void SAL_CALL OInputStreamHelper::seek( sal_Int64 location ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception) { ::osl::MutexGuard aGuard( m_aMutex ); - // cast is truncating, but position would be truncated as soon as - // put into SvLockBytes anyway - m_nActPos = sal::static_int_cast<sal_uInt32>(location); + m_nActPos = location; } sal_Int64 SAL_CALL OInputStreamHelper::getPosition( ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException, std::exception) |