diff options
author | Kurt Zenker <kz@openoffice.org> | 2009-12-01 13:17:08 +0100 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2009-12-01 13:17:08 +0100 |
commit | fd488e2c4eb52dc63f47c99be001143f2779ec28 (patch) | |
tree | f8ea15ba4c80236824df1d4b858093d964ccd055 /package | |
parent | 288a0a8e8bf809e74e023add370c517f0a22c6d7 (diff) | |
parent | 41708f4d14f1c7ec3fe0d47c273a63fd36677f35 (diff) |
CWS-TOOLING: integrate CWS dba33a
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() ); |