summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-11 08:13:48 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-11 12:04:03 +0200
commit2e6afbe65c75c919665927f62efa21140a020d46 (patch)
tree4f01651bb37dc803351d327a03cb6bfa0ccdbd60
parent99503fa006497a88e4dc413a3f85af19d720874c (diff)
tdf#79877 perf loading docx file, activate SAX threading
our nice threaded parser was not kicking in because it checks the size of the stream with available(), and this available() implementation was just returning 0. This makes for a 5-10% performance improvement Change-Id: I6516862c9c63136b54ca825dd98e35e6d87d4227 Reviewed-on: https://gerrit.libreoffice.org/57263 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--ucb/source/ucp/file/filinpstr.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/ucb/source/ucp/file/filinpstr.cxx b/ucb/source/ucp/file/filinpstr.cxx
index 997605a79409..faa16cd2783a 100644
--- a/ucb/source/ucp/file/filinpstr.cxx
+++ b/ucb/source/ucp/file/filinpstr.cxx
@@ -155,7 +155,8 @@ XInputStream_impl::skipBytes( sal_Int32 nBytesToSkip )
sal_Int32 SAL_CALL
XInputStream_impl::available()
{
- return 0;
+ sal_Int64 avail = getLength() - getPosition();
+ return std::min<sal_Int64>(avail, SAL_MAX_INT32);
}