fixed wxStreamBuffer::Tell() to return at least sometimes a valid result
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -613,9 +613,21 @@ off_t wxStreamBuffer::Seek(off_t pos, wxSeekMode mode)
|
|||||||
|
|
||||||
off_t wxStreamBuffer::Tell() const
|
off_t wxStreamBuffer::Tell() const
|
||||||
{
|
{
|
||||||
off_t pos = m_stream->OnSysTell();
|
off_t pos;
|
||||||
if ( pos == wxInvalidOffset )
|
|
||||||
return wxInvalidOffset;
|
// only ask the stream for position if we have a real stream and not a
|
||||||
|
// dummy one which we created ourselves, otherwise we'd call
|
||||||
|
// wxStream::OnSysTell() which would always return wxInvalidOffset
|
||||||
|
if ( !m_destroystream )
|
||||||
|
{
|
||||||
|
pos = m_stream->OnSysTell();
|
||||||
|
if ( pos == wxInvalidOffset )
|
||||||
|
return wxInvalidOffset;
|
||||||
|
}
|
||||||
|
else // no associated stream
|
||||||
|
{
|
||||||
|
pos = 0;
|
||||||
|
}
|
||||||
|
|
||||||
pos += GetIntPosition();
|
pos += GetIntPosition();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user