diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-05-19 12:09:22 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-05-19 12:09:22 +0000 |
commit | 80167cbf3c532f01de3f1040c4f107c388110a78 (patch) | |
tree | a9eaa57a1b881fa92d931571c4833726ab43e946 /bridges | |
parent | 434c4038d8c2efccf4bbe58b4191d47540fe5ffd (diff) |
INTEGRATION: CWS uno8eabugs01 (1.10.108); FILE MERGED
2004/05/17 14:17:21 kso 1.10.108.1: #116445# - Improved exception handling.
Diffstat (limited to 'bridges')
-rw-r--r-- | bridges/source/cpp_uno/cc50_solaris_intel/except.cxx | 62 |
1 files changed, 39 insertions, 23 deletions
diff --git a/bridges/source/cpp_uno/cc50_solaris_intel/except.cxx b/bridges/source/cpp_uno/cc50_solaris_intel/except.cxx index 9eff8c643e3c..c5dad05f3c57 100644 --- a/bridges/source/cpp_uno/cc50_solaris_intel/except.cxx +++ b/bridges/source/cpp_uno/cc50_solaris_intel/except.cxx @@ -2,9 +2,9 @@ * * $RCSfile: except.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: vg $ $Date: 2003-04-15 16:23:52 $ + * last change: $Author: rt $ $Date: 2004-05-19 13:09:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -341,6 +341,9 @@ static void deleteException( void* pExc ) typelib_TypeDescription* pType = (typelib_TypeDescription*)((void**)pExc)[-2]; uno_destructData( pExc, pType, cpp_release ); typelib_typedescription_release( pType ); +#if OSL_DEBUG_LEVEL > 0 + pType = 0; +#endif } //__________________________________________________________________________________________________ @@ -401,36 +404,49 @@ void cc50_solaris_intel_raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cp void cc50_solaris_intel_fillUnoException( void* pCppExc, const char* pInfo, + typelib_TypeDescription * pExcTypeDescr, uno_Any* pUnoExc, uno_Mapping * pCpp2Uno ) { - OString uno_name( toUNOname( pInfo ) ); -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "> c++ exception occured: %s\n", uno_name.getStr() ); -#endif - typelib_TypeDescription * pExcTypeDescr = 0; - OUString aName( OStringToOUString( uno_name, RTL_TEXTENCODING_ASCII_US ) ); - typelib_typedescription_getByName( &pExcTypeDescr, aName.pData ); - if (0 == pExcTypeDescr) // the thing that should not be + if (pExcTypeDescr == 0) { - RuntimeException aRE( - OUString( RTL_CONSTASCII_USTRINGPARAM("exception type not found: ") ) + aName, - Reference< XInterface >() ); - Type const & rType = ::getCppuType( &aRE ); - uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno ); + OSL_ASSERT( pInfo != 0 ); + OString uno_name( toUNOname( pInfo ) ); + OUString aName( OStringToOUString( + uno_name, RTL_TEXTENCODING_ASCII_US ) ); + typelib_typedescription_getByName( &pExcTypeDescr, aName.pData ); + + if (pExcTypeDescr == 0) // the thing that should not be + { + RuntimeException aRE( + OUString( RTL_CONSTASCII_USTRINGPARAM( + "exception type not found: ") ) + aName, + Reference< XInterface >() ); + Type const & rType = ::getCppuType( &aRE ); + uno_type_any_constructAndConvert( + pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno ); #if OSL_DEBUG_LEVEL > 0 - OString cstr( OUStringToOString( aRE.Message, RTL_TEXTENCODING_ASCII_US ) ); - OSL_ENSURE( 0, cstr.getStr() ); + OString cstr( OUStringToOString( + aRE.Message, RTL_TEXTENCODING_ASCII_US ) ); + OSL_ENSURE( 0, cstr.getStr() ); #endif - // though this unknown exception leaks now, no user-defined exception - // is ever thrown thru the binary C-UNO dispatcher call stack. + return; + } } else - { - // construct uno exception any - uno_any_constructAndConvert( pUnoExc, pCppExc, pExcTypeDescr, pCpp2Uno ); + pInfo = 0; + +#if OSL_DEBUG_LEVEL > 1 + fprintf( stderr, "> c++ exception occured: %s\n", + ::rtl::OUStringToOString( + pExcTypeDescr->pTypeName, + RTL_TEXTENCODING_ASCII_US ).getStr() ); +#endif + // construct uno exception any + uno_any_constructAndConvert( + pUnoExc, pCppExc, pExcTypeDescr, pCpp2Uno ); + if (pInfo != 0) typelib_typedescription_release( pExcTypeDescr ); - } } } |