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 /forms | |
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 'forms')
-rw-r--r-- | forms/source/component/DatabaseForm.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 74fbaf77e6be..873781f580ce 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -496,7 +496,7 @@ Sequence<sal_Int8> ODatabaseForm::GetDataMultiPartEncoded(const Reference<XContr } pBuf.reset(); - aMemStream.Flush(); + aMemStream.FlushBuffer(); aMemStream.Seek( 0 ); void const * pData = aMemStream.GetData(); sal_Int32 nLen = aMemStream.TellEnd(); @@ -940,7 +940,7 @@ void ODatabaseForm::InsertTextPart( INetMIMEMessage& rParent, std::u16string_vie // Body SvMemoryStream* pStream = new SvMemoryStream; pStream->WriteLine( OUStringToOString(rData, rtl_getTextEncodingFromMimeCharset(pBestMatchingEncoding)) ); - pStream->Flush(); + pStream->FlushBuffer(); pStream->Seek( 0 ); pChild->SetDocumentLB( new SvLockBytes(pStream, true) ); rParent.AttachChild( std::move(pChild) ); |