summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authormatt_51 <matthieu.gay.cap@gmail.com>2013-11-05 11:40:56 +0100
committerAndras Timar <andras.timar@collabora.com>2013-11-27 16:37:42 +0100
commit88652b1b0921c623eb43b249b16a240d57f8cb28 (patch)
treedf406e1e6275b82f3d099c900ceefa9134069fe7 /sfx2
parente88d373ce0e2b65308e56a8312c9b297aad61d0b (diff)
fdo#70345 Reuse XStream for Windows platform create a new one for others.
Reviewed-on: https://gerrit.libreoffice.org/6580 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 3d12549335229aca1a6a57575292111274709992) Change-Id: I911c24b82b55445c6f95e14be29759e2fe3d9dfd Reviewed-on: https://gerrit.libreoffice.org/6761 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/docfile.cxx21
1 files changed, 17 insertions, 4 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index c1ad6037aa87..06d7a4b8e79e 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -641,13 +641,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();
}
}