summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-01-11 17:11:06 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-07-16 16:55:54 +0200
commitdb3002eae843056dcfbd6d7ad0ad333ee53251f9 (patch)
tree43edca312cb3f65154f9bf06b220af6d47346fdc /sfx2
parent27d0abe7eca73722980228520f3a3ccdf3f844a3 (diff)
ODT export: handle NoFileSync store option
SfxMedium already had a m_bDisableFileSync member; if the medium has a storage, then forward this flag to it, so at the end SwitchablePersistenceStream::waitForCompletion() (and the called fileaccess::XStream_impl::waitForCompletion()) does not call osl_syncFile(), either. Times for 100 hello world inputs: 12594 -> 5281 ms is spent in XHTML-load + ODT export + close (42% of original). Change-Id: I2aab6c9e6baf133b211620004dcea66bd41ffc6f Reviewed-on: https://gerrit.libreoffice.org/47766 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> (cherry picked from commit 16a522361698ea53ab253d67e31cb51802210d71)
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/docfile.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index c6e4a55e2091..c79e2246eae4 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -124,6 +124,7 @@
#include <openflag.hxx>
#include <sfx2/sfxresid.hxx>
#include <officecfg/Office/Common.hxx>
+#include <comphelper/propertysequence.hxx>
#include <com/sun/star/io/WrongFormatException.hpp>
@@ -1428,6 +1429,14 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( bool bCreateTempIfNo )
aArgs[0] <<= pImpl->xStream;
aArgs[1] <<= embed::ElementModes::READWRITE;
pImpl->bStorageBasedOnInStream = true;
+ if (pImpl->m_bDisableFileSync)
+ {
+ // Forward NoFileSync to the storage factory.
+ aArgs.realloc(3);
+ uno::Sequence<beans::PropertyValue> aProperties(
+ comphelper::InitPropertySequence({ { "NoFileSync", uno::makeAny(true) } }));
+ aArgs[2] <<= aProperties;
+ }
}
else if ( pImpl->xInputStream.is() )
{