From ac07edec79149c8e90846b8a794a893e91c65c0d Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Mon, 17 May 2010 14:10:13 +0200 Subject: npower13_objectmodules: #i111007# do not close output stream of tempfile for OLE storage too early --- oox/source/ole/olestorage.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'oox/source/ole/olestorage.cxx') diff --git a/oox/source/ole/olestorage.cxx b/oox/source/ole/olestorage.cxx index 39ecbb84a062..0ca2992d47ad 100755 --- a/oox/source/ole/olestorage.cxx +++ b/oox/source/ole/olestorage.cxx @@ -252,8 +252,11 @@ void OleStorage::initStorage( const Reference< XInputStream >& rxInStream ) Reference< XStream > xTempFile( mxFactory->createInstance( CREATE_OUSTRING( "com.sun.star.io.TempFile" ) ), UNO_QUERY_THROW ); { Reference< XOutputStream > xOutStrm( xTempFile->getOutputStream(), UNO_SET_THROW ); - BinaryXOutputStream aOutStrm( xOutStrm, true ); // true = close output stream on destruction of aOutStrm - BinaryXInputStream aInStrm( xInStrm, false ); // false = do not close intput stream on destruction of aInStrm + /* Pass false to both binary stream objects to keep the UNO + streams alive. Life time of these streams is controlled by the + tempfile implementation. */ + BinaryXOutputStream aOutStrm( xOutStrm, false ); + BinaryXInputStream aInStrm( xInStrm, false ); aInStrm.copyToStream( aOutStrm ); } // scope closes output stream of tempfile xInStrm = xTempFile->getInputStream(); -- cgit