diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-10 11:51:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-10 17:59:45 +0100 |
commit | 17950f4d204e9947f125ebc0aac1156eba6501f2 (patch) | |
tree | 1b51bdc13a1006aeb29a6dff658ba1b3f1028708 /unotools | |
parent | 952b3b227e02ae4eedce3138fcb39613bf12486d (diff) |
use less SvStream::Flush()
Flush() turns into a sync() on the device, which is pretty slow.
Most of the time all we actually want to do is to flush the internal
buffers from the SvStream.
So expose the FlushBuffer method and use that where possible.
And also means we don't need the mbDontFlushOnClose flag on SvStream
any more.
Change-Id: Ibe089b88b325f0fdc565200a97ce72cd26b7fcfb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128214
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/streaming/streamwrap.cxx | 4 | ||||
-rw-r--r-- | unotools/source/ucbhelper/tempfile.cxx | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/unotools/source/streaming/streamwrap.cxx b/unotools/source/streaming/streamwrap.cxx index 9a9b53d1f1ec..ccd9b5033d2a 100644 --- a/unotools/source/streaming/streamwrap.cxx +++ b/unotools/source/streaming/streamwrap.cxx @@ -208,7 +208,7 @@ void SAL_CALL OOutputStreamWrapper::writeBytes(const css::uno::Sequence< sal_Int void SAL_CALL OOutputStreamWrapper::flush() { - rStream.Flush(); + rStream.FlushBuffer(); checkError(); } @@ -298,7 +298,7 @@ void SAL_CALL OStreamWrapper::writeBytes(const css::uno::Sequence< sal_Int8 >& a void SAL_CALL OStreamWrapper::flush() { - m_pSvStream->Flush(); + m_pSvStream->FlushBuffer(); if (m_pSvStream->GetError() != ERRCODE_NONE) throw css::io::NotConnectedException(OUString(),static_cast<css::uno::XWeak*>(this)); } diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx index 02770fda8744..07889ffdab83 100644 --- a/unotools/source/ucbhelper/tempfile.cxx +++ b/unotools/source/ucbhelper/tempfile.cxx @@ -388,9 +388,6 @@ TempFile::~TempFile() if ( !bKillingFileEnabled ) return; - // if we're going to delete this file, no point in flushing it when closing - if (pStream && !aName.isEmpty()) - static_cast<SvFileStream*>(pStream.get())->SetDontFlushOnClose(true); pStream.reset(); if ( bIsDirectory ) { |