diff options
Diffstat (limited to 'package')
-rw-r--r-- | package/source/xstor/owriteablestream.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index d1b548777..c04fb17ca 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -592,18 +592,21 @@ uno::Reference< lang::XMultiServiceFactory > OWriteStream_Impl::GetServiceFactor if ( aData.getLength() > nRead ) aData.realloc( nRead ); - if ( nRead && nRead <= MAX_STORCACHE_SIZE ) + if ( nRead <= MAX_STORCACHE_SIZE ) { uno::Reference< io::XStream > xCacheStream = CreateMemoryStream( GetServiceFactory() ); OSL_ENSURE( xCacheStream.is(), "If the stream can not be created an exception must be thrown!\n" ); - uno::Reference< io::XOutputStream > xOutStream( xCacheStream->getOutputStream(), uno::UNO_SET_THROW ); - xOutStream->writeBytes( aData ); + if ( nRead ) + { + uno::Reference< io::XOutputStream > xOutStream( xCacheStream->getOutputStream(), uno::UNO_SET_THROW ); + xOutStream->writeBytes( aData ); + } m_xCacheSeek.set( xCacheStream, uno::UNO_QUERY_THROW ); m_xCacheStream = xCacheStream; m_xCacheSeek->seek( 0 ); } - else if ( nRead && !m_aTempURL.getLength() ) + else if ( !m_aTempURL.getLength() ) { m_aTempURL = GetNewTempFileURL( GetServiceFactory() ); |