summaryrefslogtreecommitdiff
path: root/sot/source
diff options
context:
space:
mode:
Diffstat (limited to 'sot/source')
-rw-r--r--sot/source/sdstor/ucbstorage.cxx11
1 files changed, 2 insertions, 9 deletions
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index d7ffbbf7a756..a9780879e907 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -203,17 +203,10 @@ sal_Int32 SAL_CALL FileStreamWrapper_Impl::available()
::osl::MutexGuard aGuard( m_aMutex );
checkConnected();
- sal_uInt32 nPos = m_pSvStream->Tell();
- checkError();
-
- m_pSvStream->Seek(STREAM_SEEK_TO_END);
- checkError();
-
- sal_Int32 nAvailable = static_cast<sal_Int32>(m_pSvStream->Tell()) - nPos;
- m_pSvStream->Seek(nPos);
+ sal_Int64 nAvailable = m_pSvStream->remainingSize();
checkError();
- return nAvailable;
+ return std::min<sal_Int64>(SAL_MAX_INT32, nAvailable);
}