diff options
Diffstat (limited to 'tools/source/stream/stream.cxx')
-rw-r--r-- | tools/source/stream/stream.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index 818726b2a619..a0160348dff7 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -1425,12 +1425,21 @@ bool checkSeek(SvStream &rSt, sal_uInt64 nOffset) sal_uInt64 SvStream::remainingSize() { sal_uInt64 const nCurr = Tell(); - sal_uInt64 const nEnd = Seek(STREAM_SEEK_TO_END); + sal_uInt64 const nEnd = TellEnd(); sal_uInt64 nMaxAvailable = nEnd > nCurr ? (nEnd-nCurr) : 0; Seek(nCurr); return nMaxAvailable; } +sal_uInt64 SvStream::TellEnd() +{ + FlushBuffer(true); + sal_uInt64 const nCurr = Tell(); + sal_uInt64 const nEnd = Seek(STREAM_SEEK_TO_END); + Seek(nCurr); + return nEnd; +} + void SvStream::Flush() { FlushBuffer(m_isConsistent); @@ -1903,11 +1912,6 @@ void SvMemoryStream::SetSize(sal_uInt64 const nNewSize) ReAllocateMemory( nDiff ); } -sal_uInt64 SvStream::TellEnd() -{ - return Tell() + remainingSize(); -} - //Create a OString of nLen bytes from rStream OString read_uInt8s_ToOString(SvStream& rStrm, std::size_t nLen) { |