diff options
author | Mathias Bauer <mba@openoffice.org> | 2000-10-16 15:22:17 +0000 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2000-10-16 15:22:17 +0000 |
commit | 4335c63284c7bf36124aa62174593ab161d313f8 (patch) | |
tree | ebfba994014255c122d90708869cacc5454a71aa /unotools | |
parent | e93272d43f24b6640d2b681ecae028bebe589b3c (diff) |
Wrong error handling
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/ucbhelper/ucblockbytes.cxx | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx index b3069133984c..0cd794af42b4 100644 --- a/unotools/source/ucbhelper/ucblockbytes.cxx +++ b/unotools/source/ucbhelper/ucblockbytes.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ucblockbytes.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: mba $ $Date: 2000-10-16 14:16:35 $ + * last change: $Author: mba $ $Date: 2000-10-16 16:22:17 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -460,6 +460,9 @@ sal_Bool UcbLockBytes::setInputStream_Impl( const Reference<XInputStream> &rxInp bRet = m_xInputStream.is(); aGuard.clear(); + if ( GetError() == ERRCODE_NONE && !rxInputStream.is() ) + SetError( ERRCODE_IO_NOTEXISTS ); + if ( m_bStreamValid ) m_aInitialized.set(); @@ -511,7 +514,9 @@ ErrCode UcbLockBytes::ReadAt ( ULONG nPos, void *pBuffer, ULONG nCount, ULONG *p if ( !xStream.is() ) { - if ( m_bTerminated ) + if ( GetError() ) + return GetError(); + else if ( m_bTerminated ) return ERRCODE_IO_CANTREAD; else return ERRCODE_IO_PENDING; @@ -595,7 +600,12 @@ ErrCode UcbLockBytes::Stat( SvLockBytesStat *pStat, SvLockBytesStatFlag) const Reference<XInputStream> xStream = getInputStream_Impl(); if (!xStream.is()) - return ERRCODE_IO_INVALIDACCESS; + { + if ( GetError() ) + return GetError(); + else + return ERRCODE_IO_INVALIDACCESS; + } Reference<XSeekable> xSeekable (xStream, UNO_QUERY); if (!xSeekable.is()) |