summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-01-10 11:51:40 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-01-10 17:59:45 +0100
commit17950f4d204e9947f125ebc0aac1156eba6501f2 (patch)
tree1b51bdc13a1006aeb29a6dff658ba1b3f1028708 /sfx2
parent952b3b227e02ae4eedce3138fcb39613bf12486d (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 'sfx2')
-rw-r--r--sfx2/source/doc/docfile.cxx4
-rw-r--r--sfx2/source/doc/graphhelp.cxx2
2 files changed, 3 insertions, 3 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 588e349a2e5b..cfa203a85b44 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -829,9 +829,9 @@ bool SfxMedium::Commit()
if( pImpl->xStorage.is() )
StorageCommit_Impl();
else if( pImpl->m_pOutStream )
- pImpl->m_pOutStream->Flush();
+ pImpl->m_pOutStream->FlushBuffer();
else if( pImpl->m_pInStream )
- pImpl->m_pInStream->Flush();
+ pImpl->m_pInStream->FlushBuffer();
if ( GetError() == ERRCODE_NONE )
{
diff --git a/sfx2/source/doc/graphhelp.cxx b/sfx2/source/doc/graphhelp.cxx
index 04b55df9c18c..dffb1bce163a 100644
--- a/sfx2/source/doc/graphhelp.cxx
+++ b/sfx2/source/doc/graphhelp.cxx
@@ -188,7 +188,7 @@ bool GraphicHelper::getThumbnailFormatFromBitmap_Impl(const BitmapEx& rBitmap, c
if (rFilter.compressAsPNG(bitmap, *pStream) != ERRCODE_NONE)
return false;
- pStream->Flush();
+ pStream->FlushBuffer();
return !pStream->GetError();
}