From 19da72379ffc6cf261eaa86986695e38c8f228df Mon Sep 17 00:00:00 2001 From: Guillermo Rodriguez Garcia Date: Tue, 29 Feb 2000 21:05:12 +0000 Subject: [PATCH] Tell is now compatible with the wback buffer git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6364 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/stream.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/common/stream.cpp b/src/common/stream.cpp index 16ab8391cb..ef92a1807a 100644 --- a/src/common/stream.cpp +++ b/src/common/stream.cpp @@ -625,7 +625,13 @@ off_t wxInputStream::SeekI(off_t pos, wxSeekMode mode) /* A call to SeekI() will automatically invalidate any previous call to Ungetch(), otherwise it would be possible to SeekI() to one one position, unread some bytes there, SeekI() to another position - and the data would be corrupted. */ + and the data would be corrupted. + + GRG: Could add code here to try to navigate within the wback + buffer if possible, but is it really needed? It would only work + when seeking in wxFromCurrent mode, else it would invalidate + anyway... + */ if (m_wback) { free(m_wback); @@ -639,7 +645,13 @@ off_t wxInputStream::SeekI(off_t pos, wxSeekMode mode) off_t wxInputStream::TellI() const { - return OnSysTell(); + /* GRG: Changed to make it compatible with the wback buffer */ + off_t pos = OnSysTell(); + + if (pos != wxInvalidOffset) + pos -= (m_wbacksize - m_wbackcur); + + return pos; } // -------------------- -- 2.45.2