[Libreoffice-commits] core.git: sfx2/source

Michael Stahl mstahl at redhat.com
Thu Apr 2 12:09:24 PDT 2015


 sfx2/source/doc/docfile.cxx |   15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 7c4415407f2df5460d3667aa9f820865a615f57f
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Apr 2 15:57:47 2015 +0200

    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

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 407a649..e0158ae 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();
         }
     }


More information about the Libreoffice-commits mailing list