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 --- xmlsecurity/source/helper/xmlsignaturehelper2.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'xmlsecurity/source/helper/xmlsignaturehelper2.cxx') diff --git a/xmlsecurity/source/helper/xmlsignaturehelper2.cxx b/xmlsecurity/source/helper/xmlsignaturehelper2.cxx index 8d5a0d0d2513..bb281b10be88 100644 --- a/xmlsecurity/source/helper/xmlsignaturehelper2.cxx +++ b/xmlsecurity/source/helper/xmlsignaturehelper2.cxx @@ -58,9 +58,7 @@ uno::Reference< io::XInputStream > SAL_CALL UriBindingHelper::getUriBinding( con else { SvFileStream* pStream = new SvFileStream( uri, StreamMode::READ ); - pStream->Seek( STREAM_SEEK_TO_END ); - sal_uLong nBytes = pStream->Tell(); - pStream->Seek( STREAM_SEEK_TO_BEGIN ); + sal_uLong nBytes = pStream->TellEnd(); SvLockBytesRef xLockBytes = new SvLockBytes( pStream, true ); xInputStream = new utl::OInputStreamHelper( xLockBytes, nBytes ); } -- cgit