diff options
author | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2011-02-28 15:24:56 +0100 |
---|---|---|
committer | Daniel Rentz [dr] <daniel.rentz@oracle.com> | 2011-02-28 15:24:56 +0100 |
commit | 1864247d585887383a0537bb9eb5be2d012cfded (patch) | |
tree | bf1b54c964dd6a3b2b240fb9250716cd9f19fd85 /oox | |
parent | 35c2ef4569695240bccebe9e6c56a74b23edd984 (diff) |
dr78: #i116996# remove wrong assertions
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/helper/binaryinputstream.cxx | 5 | ||||
-rw-r--r-- | oox/source/helper/binaryoutputstream.cxx | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/oox/source/helper/binaryinputstream.cxx b/oox/source/helper/binaryinputstream.cxx index e61000675006..58c7cca37008 100644 --- a/oox/source/helper/binaryinputstream.cxx +++ b/oox/source/helper/binaryinputstream.cxx @@ -155,7 +155,7 @@ BinaryXInputStream::BinaryXInputStream( const Reference< XInputStream >& rxInStr BinaryXSeekableStream( Reference< XSeekable >( rxInStrm, UNO_QUERY ) ), maBuffer( INPUTSTREAM_BUFFERSIZE ), mxInStrm( rxInStrm ), - mbAutoClose( bAutoClose ) + mbAutoClose( bAutoClose && rxInStrm.is() ) { mbEof = !mxInStrm.is(); } @@ -167,7 +167,7 @@ BinaryXInputStream::~BinaryXInputStream() void BinaryXInputStream::close() { - OSL_ENSURE( mxInStrm.is(), "BinaryXInputStream::close - invalid call" ); + OSL_ENSURE( !mbAutoClose || mxInStrm.is(), "BinaryXInputStream::close - invalid call" ); if( mbAutoClose && mxInStrm.is() ) try { mxInStrm->closeInput(); @@ -177,6 +177,7 @@ void BinaryXInputStream::close() OSL_ENSURE( false, "BinaryXInputStream::close - closing input stream failed" ); } mxInStrm.clear(); + mbAutoClose = false; BinaryXSeekableStream::close(); } diff --git a/oox/source/helper/binaryoutputstream.cxx b/oox/source/helper/binaryoutputstream.cxx index 1ae7b15d7595..2f894ccf1bf2 100644 --- a/oox/source/helper/binaryoutputstream.cxx +++ b/oox/source/helper/binaryoutputstream.cxx @@ -52,7 +52,7 @@ BinaryXOutputStream::BinaryXOutputStream( const Reference< XOutputStream >& rxOu BinaryXSeekableStream( Reference< XSeekable >( rxOutStrm, UNO_QUERY ) ), maBuffer( OUTPUTSTREAM_BUFFERSIZE ), mxOutStrm( rxOutStrm ), - mbAutoClose( bAutoClose ) + mbAutoClose( bAutoClose && rxOutStrm.is() ) { mbEof = !mxOutStrm.is(); } @@ -64,7 +64,7 @@ BinaryXOutputStream::~BinaryXOutputStream() void BinaryXOutputStream::close() { - OSL_ENSURE( mxOutStrm.is(), "BinaryXOutputStream::close - invalid call" ); + OSL_ENSURE( !mbAutoClose || mxOutStrm.is(), "BinaryXOutputStream::close - invalid call" ); if( mxOutStrm.is() ) try { mxOutStrm->flush(); @@ -76,6 +76,7 @@ void BinaryXOutputStream::close() OSL_ENSURE( false, "BinaryXOutputStream::close - closing output stream failed" ); } mxOutStrm.clear(); + mbAutoClose = false; BinaryXSeekableStream::close(); } |