From 9ec8bf8f22fe74884185492ef2576ce79b41e4f1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 11 Oct 2018 18:49:34 +0200 Subject: add SvStream::TellEnd and simplify callsites to use it instead of the current "seek to end, find pos, seek back to original pos" pattern Change-Id: Ib5828868f73c341891efc759af8bd4695ae2f33c Reviewed-on: https://gerrit.libreoffice.org/61738 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/tools/stream.hxx | 1 + 1 file changed, 1 insertion(+) (limited to 'include/tools') diff --git a/include/tools/stream.hxx b/include/tools/stream.hxx index 3793094155d6..dc2c926c371e 100644 --- a/include/tools/stream.hxx +++ b/include/tools/stream.hxx @@ -273,6 +273,7 @@ public: sal_uInt64 Seek( sal_uInt64 nPos ); sal_uInt64 SeekRel( sal_Int64 nPos ); sal_uInt64 Tell() const { return m_nBufFilePos + m_nBufActualPos; } + sal_uInt64 TellEnd() { return Tell() + remainingSize(); } // length between current (Tell()) pos and end of stream virtual sal_uInt64 remainingSize(); void Flush(); -- cgit