summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2009-12-01 13:17:08 +0100
committerKurt Zenker <kz@openoffice.org>2009-12-01 13:17:08 +0100
commit749127e0507385584bdac9392174bebaba863546 (patch)
treef0e0e2ea9217119fef5af71fbd43e3f943de1079 /package
parentd3af929cd34466863ef2699e3398b1fd0ffae337 (diff)
parent764026f7d09f18e5757c588439f925bb725c99d1 (diff)
CWS-TOOLING: integrate CWS dba33a
Diffstat (limited to 'package')
-rw-r--r--package/source/xstor/owriteablestream.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx
index 67e71baf8533..8d540a663098 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() );