diff options
Diffstat (limited to 'extensions/source/ole/oleobjw.cxx')
-rw-r--r-- | extensions/source/ole/oleobjw.cxx | 64 |
1 files changed, 41 insertions, 23 deletions
diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx index 8238088e641f..73ef6bd60df1 100644 --- a/extensions/source/ole/oleobjw.cxx +++ b/extensions/source/ole/oleobjw.cxx @@ -29,11 +29,13 @@ #include <com/sun/star/script/CannotConvertException.hpp> #include <com/sun/star/script/FailReason.hpp> #include <com/sun/star/beans/XMaterialHolder.hpp> +#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <com/sun/star/script/XInvocation.hpp> #include <com/sun/star/bridge/ModelDependent.hpp> #include <com/sun/star/bridge/oleautomation/NamedArgument.hpp> #include <com/sun/star/bridge/oleautomation/PropertyPutArgument.hpp> +#include <cppuhelper/exc_hlp.hxx> #include <typelib/typedescription.hxx> #include <rtl/uuid.h> @@ -158,9 +160,11 @@ Any SAL_CALL IUnknownWrapper::invokeGetProperty( const OUString& aPropertyName, } catch ( const Exception& e ) { - throw RuntimeException("[automation bridge] unexpected exception in " - "IUnknownWrapper::invokeGetProperty ! Message : \n" + - e.Message); + css::uno::Any anyEx = cppu::getCaughtException(); + throw css::lang::WrappedTargetRuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper::invokeGetProperty ! Message : \n " + + e.Message, + nullptr, anyEx ); } return aResult; } @@ -186,9 +190,11 @@ Any SAL_CALL IUnknownWrapper::invokePutProperty( const OUString& aPropertyName, } catch ( const Exception& e ) { - throw RuntimeException("[automation bridge] unexpected exception in " - "IUnknownWrapper::invokePutProperty ! Message : \n" + - e.Message); + css::uno::Any anyEx = cppu::getCaughtException(); + throw css::lang::WrappedTargetRuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper::invokePutProperty ! Message : \n" + + e.Message, + nullptr, anyEx ); } return aResult; } @@ -241,9 +247,11 @@ Any SAL_CALL IUnknownWrapper::invoke( const OUString& aFunctionName, } catch (const Exception & e) { - throw RuntimeException("[automation bridge] unexpected exception in " - "IUnknownWrapper::invoke ! Message : \n" + - e.Message); + css::uno::Any anyEx = cppu::getCaughtException(); + throw css::lang::WrappedTargetRuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper::invoke ! Message : \n" + + e.Message, + nullptr, anyEx ); } catch(...) @@ -408,9 +416,11 @@ void SAL_CALL IUnknownWrapper::setValue( const OUString& aPropertyName, } catch (const Exception & e) { - throw RuntimeException("[automation bridge] unexpected exception in " - "IUnknownWrapper::setValue ! Message : \n" + - e.Message); + css::uno::Any anyEx = cppu::getCaughtException(); + throw css::lang::WrappedTargetRuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper::setValue ! Message : \n" + + e.Message, + nullptr, anyEx ); } catch (...) @@ -550,9 +560,11 @@ Any SAL_CALL IUnknownWrapper::getValue( const OUString& aPropertyName ) } catch (const Exception & e) { - throw RuntimeException("[automation bridge] unexpected exception in " - "IUnknownWrapper::getValue ! Message : \n" + - e.Message); + css::uno::Any anyEx = cppu::getCaughtException(); + throw css::lang::WrappedTargetRuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper::getValue ! Message : \n" + + e.Message, + nullptr, anyEx ); } catch (...) { @@ -599,9 +611,11 @@ sal_Bool SAL_CALL IUnknownWrapper::hasMethod( const OUString& aName ) } catch (const Exception & e) { - throw RuntimeException("[automation bridge] unexpected exception in " - "IUnknownWrapper::hasMethod ! Message : \n" + - e.Message); + css::uno::Any anyEx = cppu::getCaughtException(); + throw css::lang::WrappedTargetRuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper::hasMethod ! Message : \n" + + e.Message, + nullptr, anyEx ); } catch (...) { @@ -648,9 +662,11 @@ sal_Bool SAL_CALL IUnknownWrapper::hasProperty( const OUString& aName ) } catch (const Exception & e) { - throw RuntimeException("[automation bridge] unexpected exception in " - "IUnknownWrapper::hasProperty ! Message : \n" + - e.Message); + css::uno::Any anyEx = cppu::getCaughtException(); + throw css::lang::WrappedTargetRuntimeException("[automation bridge] unexpected exception in " + "IUnknownWrapper::hasProperty ! Message : \n" + + e.Message, + nullptr, anyEx ); } catch (...) @@ -1211,8 +1227,10 @@ void SAL_CALL IUnknownWrapper::initialize( const Sequence< Any >& aArguments ) } catch( const Exception& e ) { - throw RuntimeException( - "[automation bridge] unexpected exception in IUnknownWrapper::initialize() error message: \n" + e.Message ); + css::uno::Any anyEx = cppu::getCaughtException(); + throw css::lang::WrappedTargetRuntimeException( + "[automation bridge] unexpected exception in IUnknownWrapper::initialize() error message: \n" + e.Message, + nullptr, anyEx ); } } } |