diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-01-27 12:56:33 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-01-27 12:56:33 +0100 |
commit | 25a7a5fec731b4cd135998fa8f5cc97531c7dde6 (patch) | |
tree | fec81bb2ae30ca60ecb57273ae134713ca143542 /toolkit | |
parent | b5707b50ee83894582e14793c23466926b570b28 (diff) |
gridsort: element*: don't let non-runtime exceptions slip, this will crash on non-Windows platforms
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/controls/dialogcontrol.cxx | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index f7e2094d01aa..bbe7a1fc9c83 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -1684,7 +1684,16 @@ void UnoDialogControl::elementInserted( const ContainerEvent& Event ) throw(Runt Event.Accessor >>= aName; Event.Element >>= xModel; - ImplInsertControl( xModel, aName ); + ENSURE_OR_RETURN_VOID( xModel.is(), "UnoDialogControl::elementInserted: illegal element!" ); + try + { + ImplInsertControl( xModel, aName ); + } + catch ( const RuntimeException& e ) { throw; } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } } void UnoDialogControl::elementRemoved( const ContainerEvent& Event ) throw(RuntimeException) @@ -1693,8 +1702,16 @@ void UnoDialogControl::elementRemoved( const ContainerEvent& Event ) throw(Runti Reference< XControlModel > xModel; Event.Element >>= xModel; - if ( xModel.is() ) + ENSURE_OR_RETURN_VOID( xModel.is(), "UnoDialogControl::elementRemoved: illegal element!" ); + try + { ImplRemoveControl( xModel ); + } + catch ( const RuntimeException& e ) { throw; } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } } void UnoDialogControl::elementReplaced( const ContainerEvent& Event ) throw(RuntimeException) @@ -1703,13 +1720,31 @@ void UnoDialogControl::elementReplaced( const ContainerEvent& Event ) throw(Runt Reference< XControlModel > xModel; Event.ReplacedElement >>= xModel; - if ( xModel.is() ) - ImplRemoveControl( xModel ); + try + { + OSL_ENSURE( xModel.is(), "UnoDialogControl::elementReplaced: invalid ReplacedElement!" ); + if ( xModel.is() ) + ImplRemoveControl( xModel ); + } + catch ( const RuntimeException& e ) { throw; } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } ::rtl::OUString aName; Event.Accessor >>= aName; Event.Element >>= xModel; - ImplInsertControl( xModel, aName ); + ENSURE_OR_RETURN_VOID( xModel.is(), "UnoDialogControl::elementReplaced: invalid new element!" ); + try + { + ImplInsertControl( xModel, aName ); + } + catch ( const RuntimeException& e ) { throw; } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } } void UnoDialogControl::addTopWindowListener( const Reference< XTopWindowListener >& rxListener ) throw (RuntimeException) |