summaryrefslogtreecommitdiff
path: root/sfx2/source/doc
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-04-02 15:57:47 +0200
committerMichael Stahl <mstahl@redhat.com>2015-04-02 21:03:27 +0200
commit7c4415407f2df5460d3667aa9f820865a615f57f (patch)
tree63f817a0304eb945961ef83c92eb160b4e5263f9 /sfx2/source/doc
parent4d2923e1876e1c3a1da9056e4508be71e6cac9f3 (diff)
tdf#72337: sfx2: make the SfxMedium stream-reuse hack runtime-optional
SfxMedium::GetOutStream() does something different on WNT to solve sharing issues on one kind of file server but that causes issues with some other kind of file server that worked before. Make this runtime-changeable with (undocumented) env variable SFX_MEDIUM_REUSE_STREAM. (regression from 3d12549335229aca1a6a57575292111274709992) Change-Id: Id7a1fc8169dbf09c67a109b36ffa312ef33231c5
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r--sfx2/source/doc/docfile.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 407a64947ce5..e0158aecedcf 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -564,8 +564,9 @@ SvStream* SfxMedium::GetOutStream()
{
// 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())
+ // TODO: this is a horrible hack that should probably be removed,
+ // somebody needs to investigate this more thoroughly...
+ if (getenv("SFX_MEDIUM_REUSE_STREAM") && pImp->xStream.is())
{
assert(pImp->xStream->getOutputStream().is()); // need that...
pImp->m_pOutStream = utl::UcbStreamHelper::CreateStream(
@@ -573,15 +574,11 @@ SvStream* SfxMedium::GetOutStream()
}
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)
- #else
- pImp->m_pOutStream = new SvFileStream(
- pImp->m_aName, STREAM_STD_READWRITE);
- #endif
+ pImp->m_pOutStream = new SvFileStream(
+ pImp->m_aName, STREAM_STD_READWRITE);
+ }
CloseStorage();
}
}