Kaydet (Commit) 3d125493 authored tarafından matt_51's avatar matt_51 Kaydeden (comit) Michael Stahl

fdo#70345 Reuse XStream for Windows platform create a new one for others.

Change-Id: I911c24b82b55445c6f95e14be29759e2fe3d9dfd
Reviewed-on: https://gerrit.libreoffice.org/6580Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst 363cc397
......@@ -604,13 +604,26 @@ SvStream* SfxMedium::GetOutStream()
if ( pImp->pTempFile )
{
// don't try to re-use XOutStream from xStream if that exists;
// On windows we try to re-use XOutStream from xStream if that exists;
// because opening new SvFileStream in this situation may fail with ERROR_SHARING_VIOLATION
#ifdef WNT
if (pImp->xStream.is())
{
assert(pImp->xStream->getOutputStream().is()); // need that...
pImp->m_pOutStream = utl::UcbStreamHelper::CreateStream(
pImp->xStream, false);
}
else
{
pImp->m_pOutStream = new SvFileStream(
pImp->m_aName, STREAM_STD_READWRITE);
}
// On Unix don't try to re-use XOutStream from xStream if that exists;
// it causes fdo#59022 (fails opening files via SMB on Linux)
// OTOH opening new SvFileStream in this situation may fail on
// Windows with ERROR_SHARING_VIOLATION... but that is apparently
// not a problem in practice currently
#else
pImp->m_pOutStream = new SvFileStream(
pImp->m_aName, STREAM_STD_READWRITE);
#endif
CloseStorage();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment