diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-10-12 22:02:15 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-10-14 15:37:17 +0200 |
commit | 176e8cf09a527438ec9b2b20ba2df23fa45226bc (patch) | |
tree | 76897d74143771a9ee9249c49bbe91da9ffa0433 /stoc/source/corereflection | |
parent | 328d6aae9e2b7a73f6672800629230f5b46d15b1 (diff) |
Use exception ctors, instead of setting members later
Avoids overwriting source location in message
Change-Id: Ia0290c7dd1ab3ea1357712a27ecab75c7b583dd4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157893
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'stoc/source/corereflection')
-rw-r--r-- | stoc/source/corereflection/criface.cxx | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/stoc/source/corereflection/criface.cxx b/stoc/source/corereflection/criface.cxx index 458c7c3693a7..23d3d9bae278 100644 --- a/stoc/source/corereflection/criface.cxx +++ b/stoc/source/corereflection/criface.cxx @@ -603,17 +603,13 @@ Any SAL_CALL IdlInterfaceMethodImpl::invoke( const Any & rObj, Sequence< Any > & } TYPELIB_DANGER_RELEASE( pReturnType ); - InvocationTargetException aExc; - aExc.Context = *o3tl::doAccess<Reference<XInterface>>(rObj); - aExc.Message = "exception occurred during invocation!"; - uno_any_destruct( - &aExc.TargetException, + uno_any_destruct(&aRet, reinterpret_cast< uno_ReleaseFunc >(cpp_release) ); - uno_type_copyAndConvertData( - &aExc.TargetException, pUnoExc, cppu::UnoType<Any>::get().getTypeLibType(), + uno_type_copyAndConvertData(&aRet, pUnoExc, cppu::UnoType<Any>::get().getTypeLibType(), getReflection()->getUno2Cpp().get() ); uno_any_destruct( pUnoExc, nullptr ); - throw aExc; + throw InvocationTargetException("exception occurred during invocation!", + *o3tl::doAccess<Reference<XInterface>>(rObj), aRet); } else { |