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-01-12 12:04:44 +0100
commit16a522361698ea53ab253d67e31cb51802210d71 (patch)
tree9e9191d3b6862cb559ab5143c676a164648e8b3b /sfx2
parentef22c4a0a99be5d2903fb9e9d09fc852cd791173 (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>
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 92f0665110af..865fc60a0b71 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -121,6 +121,7 @@
#include <openflag.hxx>
#include <sfx2/sfxresid.hxx>
#include <officecfg/Office/Common.hxx>
+#include <comphelper/propertysequence.hxx>
#include <com/sun/star/io/WrongFormatException.hpp>
@@ -1369,6 +1370,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() )
{