diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2006-12-19 13:09:42 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2006-12-19 13:09:42 +0000 |
commit | efb27e9634651581dd4108fc9f788ca718e42f2d (patch) | |
tree | e323418ff14b63b18ff9b987a50bdd36ed22659c /package/source/xstor | |
parent | 185222add578f7b9adea36547cc6f57440735c98 (diff) |
INTEGRATION: CWS fwk56 (1.20.12); FILE MERGED
2006/10/31 11:52:46 mav 1.20.12.1: #140583# catch unexpected exceptions
Diffstat (limited to 'package/source/xstor')
-rw-r--r-- | package/source/xstor/owriteablestream.cxx | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index 9420cf57bd74..a02a37726bb5 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -4,9 +4,9 @@ * * $RCSfile: owriteablestream.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: obo $ $Date: 2006-10-13 11:54:09 $ + * last change: $Author: ihi $ $Date: 2006-12-19 14:09:42 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -68,6 +68,10 @@ #include <com/sun/star/embed/ElementModes.hpp> #endif +#ifndef _COM_SUN_STAR_LANG_WRAPPEDTARGETRUNTIMEEXCEPTION_HPP_ +#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> +#endif + #ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ #include <cppuhelper/typeprovider.hxx> #endif @@ -2296,14 +2300,26 @@ void SAL_CALL OWriteStream::dispose() if ( !m_bInitOnDemand ) { - if ( !m_bTransacted ) + try { - m_pImpl->Commit(); + if ( !m_bTransacted ) + { + m_pImpl->Commit(); + } + else + { + // throw away all the changes + m_pImpl->Revert(); + } } - else + catch( uno::Exception& ) { - // throw away all the changes - m_pImpl->Revert(); + uno::Any aCaught( ::cppu::getCaughtException() ); + throw lang::WrappedTargetRuntimeException( + ::rtl::OUString::createFromAscii( "Can not commit/revert the storage!\n" ), + uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), + uno::UNO_QUERY ), + aCaught ); } } |