diff options
-rw-r--r-- | basic/source/runtime/iosys.cxx | 6 | ||||
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/inputstream.cxx | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index 6f3af60aedd5..a1d9ff0b1ebc 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -377,10 +377,12 @@ sal_uIntPtr OslStream::PutData( const void* pData, sal_uIntPtr nSize ) sal_uIntPtr OslStream::SeekPos( sal_uIntPtr nPos ) { + ::osl::FileBase::RC rc = ::osl::FileBase::E_None; if( nPos == STREAM_SEEK_TO_END ) - maFile.setPos( osl_Pos_End, 0 ); + rc = maFile.setPos( osl_Pos_End, 0 ); else - maFile.setPos( osl_Pos_Absolut, (sal_uInt64)nPos ); + rc = maFile.setPos( osl_Pos_Absolut, (sal_uInt64)nPos ); + OSL_ENSURE(rc == ::osl::FileBase::E_None, "bad seek"); sal_uInt64 nRealPos(0); maFile.getPos( nRealPos ); return sal::static_int_cast<sal_uIntPtr>(nRealPos); diff --git a/xmlhelp/source/cxxhelp/provider/inputstream.cxx b/xmlhelp/source/cxxhelp/provider/inputstream.cxx index 0649c6d9e5c2..f5736b138a04 100644 --- a/xmlhelp/source/cxxhelp/provider/inputstream.cxx +++ b/xmlhelp/source/cxxhelp/provider/inputstream.cxx @@ -137,7 +137,11 @@ XInputStream_impl::skipBytes( io::IOException, uno::RuntimeException) { - m_aFile.setPos( osl_Pos_Current, sal_uInt64( nBytesToSkip ) ); + if (m_aFile.setPos(osl_Pos_Current, sal_uInt64(nBytesToSkip)) != osl::FileBase::E_None) + { + throw io::IOException(::rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("XInputStream_impl::skipBytes failed seek")), uno::Reference< uno::XInterface >()); + } } |