Adapt remaining cpp_uno bridges to #i114635#

..."C++ UNO bridge should convert non-UNO exceptions into RuntimeException"
(<https://bz.apache.org/ooo/show_bug.cgi?id=114635>), see
<https://lists.freedesktop.org/archives/libreoffice/2018-April/079985.html>
"Re: CppunitTest_sw_filters_test failing on x86 Linux, std::exception ->
uno::RuntimeException".

(The msvc_win32_{intel,x86-64} versions already handle non-UNO exceptions in
their msc{i,x}_filterCppException functions, in a different way.)

Change-Id: Ie359affed6831d16be0de3e3ff065484e28bd9c3
Reviewed-on: https://gerrit.libreoffice.org/52665
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2018-04-10 10:06:23 +02:00
parent 2ad679b7f6
commit 4544713d3a
18 changed files with 380 additions and 89 deletions

View file

@ -20,7 +20,10 @@
#include <sys/types.h>
#include <sys/malloc.h>
#include <com/sun/star/uno/Exception.hxx>
#include <com/sun/star/uno/RuntimeException.hxx>
#include <com/sun/star/uno/genfunc.hxx>
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include "bridge.hxx"
@ -29,8 +32,11 @@
#include "vtables.hxx"
#include "share.hxx"
#include <exception>
#include <stdio.h>
#include <string.h>
#include <typeinfo>
using namespace ::com::sun::star::uno;
@ -294,10 +300,20 @@ static void cpp_call(
try
{
assert( !( (pCppStack - pCppStackStart ) & 3) && "UNALIGNED STACK !!! (Please DO panic)" );
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr->eTypeClass,
pStackStart, (pStack - pStackStart), pFPR, nFPR );
try {
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr->eTypeClass,
pStackStart, (pStack - pStackStart), pFPR, nFPR );
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;

View file

@ -19,7 +19,14 @@
#ifdef __arm64
#include <sal/config.h>
#include <exception>
#include <typeinfo>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <o3tl/runtimetooustring.hxx>
#include "bridge.hxx"
#include "types.hxx"
@ -348,13 +355,23 @@ static void cpp_call(
try
{
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeRef,
pStackStart,
(pStack - pStackStart),
pGPR,
pFPR);
try {
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeRef,
pStackStart,
(pStack - pStackStart),
pGPR,
pFPR);
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;

View file

@ -17,10 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <exception>
#include <malloc.h>
#include <typeinfo>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/genfunc.hxx>
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include "bridge.hxx"
@ -323,12 +329,22 @@ static void cpp_call(
try
{
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr,
pStackStart, (pStack - pStackStart),
pGPR, nRegs,
pFPR, nRegs );
try {
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr,
pStackStart, (pStack - pStackStart),
pGPR, nRegs,
pFPR, nRegs );
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;

View file

@ -21,7 +21,9 @@
#include <rtl/alloc.h>
#include <com/sun/star/uno/genfunc.hxx>
#include <com/sun/star/uno/Exception.hpp>
#include "com/sun/star/uno/RuntimeException.hpp"
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include <bridge.hxx>
@ -31,8 +33,10 @@
#include "share.hxx"
#include <exception>
#include <stdio.h>
#include <string.h>
#include <typeinfo>
/*
* Based on http://gcc.gnu.org/PR41443
@ -524,13 +528,23 @@ static void cpp_call(
try
{
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeRef,
pStackStart,
(pStack - pStackStart),
pGPR, nGPR,
pFPR);
try {
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeRef,
pStackStart,
(pStack - pStackStart),
pGPR, nGPR,
pFPR);
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;

View file

@ -21,7 +21,9 @@
#include <rtl/alloc.h>
#include <com/sun/star/uno/genfunc.hxx>
#include <com/sun/star/uno/Exception.hpp>
#include "com/sun/star/uno/RuntimeException.hpp"
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include <bridge.hxx>
@ -31,8 +33,10 @@
#include "share.hxx"
#include <exception>
#include <stdio.h>
#include <string.h>
#include <typeinfo>
using namespace ::com::sun::star::uno;
@ -307,11 +311,21 @@ static void cpp_call(
try
{
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr, bRegisterReturn,
pStackStart,
(pStack - pStackStart), pGPR, pFPR);
try {
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr, bRegisterReturn,
pStackStart,
(pStack - pStackStart), pGPR, pFPR);
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;

View file

@ -17,10 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <exception>
#include <malloc.h>
#include <typeinfo>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/genfunc.hxx>
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include "bridge.hxx"
@ -486,12 +492,22 @@ static void cpp_call(
try
{
try {
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr, bSimpleReturn,
pStackStart, ( pStack - pStackStart ),
pGPR, nGPR,
pFPR, nFPR );
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;

View file

@ -17,11 +17,17 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <exception>
#include <typeinfo>
#include <sal/alloca.h>
#include <com/sun/star/uno/genfunc.hxx>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include <bridge.hxx>
@ -155,10 +161,20 @@ void cpp_call(
try
{
assert( !( (pCppStack - pCppStackStart ) & 3) && "UNALIGNED STACK !!! (Please DO panic)" );
CPPU_CURRENT_NAMESPACE::callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr, bSimpleReturn,
reinterpret_cast<sal_Int32 *>(pCppStackStart), (pCppStack - pCppStackStart) / sizeof(sal_Int32) );
try {
CPPU_CURRENT_NAMESPACE::callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr, bSimpleReturn,
reinterpret_cast<sal_Int32 *>(pCppStackStart), (pCppStack - pCppStackStart) / sizeof(sal_Int32) );
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = nullptr;

View file

@ -21,7 +21,9 @@
#include <rtl/alloc.h>
#include <com/sun/star/uno/genfunc.hxx>
#include <com/sun/star/uno/Exception.hpp>
#include "com/sun/star/uno/RuntimeException.hpp"
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include <bridge.hxx>
@ -31,8 +33,10 @@
#include "share.hxx"
#include <exception>
#include <stdio.h>
#include <string.h>
#include <typeinfo>
using namespace ::com::sun::star::uno;
@ -285,11 +289,21 @@ static void cpp_call(
try
{
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr->eTypeClass,
pStackStart,
(pStack - pStackStart));
try {
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr->eTypeClass,
pStackStart,
(pStack - pStackStart));
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;

View file

@ -17,9 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <malloc.h>
#include <sal/config.h>
#include <exception>
#include <malloc.h>
#include <typeinfo>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/genfunc.hxx>
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include "bridge.hxx"
@ -389,10 +396,20 @@ namespace
try
{
assert( !( (pCppStack - pCppStackStart ) & 3) && "UNALIGNED STACK !!! (Please DO panic)" );
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr->eTypeClass, pParamType,
(sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) );
try {
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr->eTypeClass, pParamType,
(sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) );
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;

View file

@ -17,10 +17,17 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <exception>
#include <malloc.h>
#include <cstring>
#include <typeinfo>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/genfunc.hxx>
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include "bridge.hxx"
@ -379,11 +386,21 @@ namespace
try
{
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeRef, bSimpleReturn,
pStackStart, ( pStack - pStackStart ),
pGPR, pFPR, nREG);
try {
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeRef, bSimpleReturn,
pStackStart, ( pStack - pStackStart ),
pGPR, pFPR, nREG);
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;

View file

@ -17,10 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <exception>
#include <malloc.h>
#include <typeinfo>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/genfunc.hxx>
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include "bridge.hxx"
@ -480,10 +486,20 @@ static void cpp_call(
try
{
assert( !( (pCppStack - pCppStackStart ) & 3) && "UNALIGNED STACK !!! (Please DO panic)");
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr->eTypeClass, pParamType,
(sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) );
try {
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr->eTypeClass, pParamType,
(sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) );
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;

View file

@ -17,10 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <exception>
#include <malloc.h>
#include <typeinfo>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/genfunc.hxx>
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include "bridge.hxx"
@ -454,12 +460,22 @@ static void cpp_call(
try
{
try {
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr,
pStackStart, ( pStack - pStackStart ),
pGPR, nGPR,
pFPR, nFPR );
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;

View file

@ -17,10 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <exception>
#include <malloc.h>
#include <typeinfo>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/genfunc.hxx>
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include "bridge.hxx"
@ -426,10 +432,20 @@ static void cpp_call(
try
{
assert( !( (pCppStack - pCppStackStart ) & 3) && "UNALIGNED STACK !!! (Please DO panic)" );
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr->eTypeClass, pParamType,
(sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) );
try {
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr->eTypeClass, pParamType,
(sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) );
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;

View file

@ -17,10 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <exception>
#include <malloc.h>
#include <typeinfo>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/genfunc.hxx>
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include "bridge.hxx"
@ -328,12 +334,22 @@ static void cpp_call(
try
{
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr,
pStackStart, (pStack - pStackStart),
pGPR, nGPR,
pFPR, nFPR );
try {
callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr,
pStackStart, (pStack - pStackStart),
pGPR, nGPR,
pFPR, nFPR );
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;

View file

@ -17,8 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <exception>
#include <malloc.h>
#include <typeinfo>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/genfunc.hxx>
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include "bridge.hxx"
@ -395,13 +403,23 @@ static void cpp_call(
if( nStackLongs & 1 )
// stack has to be 8 byte aligned
nStackLongs++;
callVirtualMethod(
pAdjustedThisPtr,
aVtableSlot.index,
pCppReturn,
pReturnTypeDescr->eTypeClass,
(sal_Int32 *)pCppStackStart,
nStackLongs);
try {
callVirtualMethod(
pAdjustedThisPtr,
aVtableSlot.index,
pCppReturn,
pReturnTypeDescr->eTypeClass,
(sal_Int32 *)pCppStackStart,
nStackLongs);
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;

View file

@ -17,8 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <exception>
#include <malloc.h>
#include <typeinfo>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/genfunc.hxx>
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include "bridge.hxx"
@ -637,15 +645,25 @@ static void cpp_call(
// pReturnTypeRef,
// pCppStackStart,
// (long long)nStackHypers);
callVirtualMethod(
pAdjustedThisPtr,
aVtableSlot.index,
pCppReturn,
pReturnTypeRef,
(sal_Int64 *)pCppStackStart,
nStackHypers,
pParams,
nParams);
try {
callVirtualMethod(
pAdjustedThisPtr,
aVtableSlot.index,
pCppReturn,
pReturnTypeRef,
(sal_Int64 *)pCppStackStart,
nStackHypers,
pParams,
nParams);
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;

View file

@ -17,12 +17,18 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <exception>
#include <typeinfo>
#include <malloc.h>
#include <sal/alloca.h>
#include <com/sun/star/uno/genfunc.hxx>
#include <com/sun/star/uno/Exception.hpp>
#include "com/sun/star/uno/RuntimeException.hpp"
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include "bridge.hxx"
@ -152,10 +158,20 @@ static void cpp_call(
try
{
assert( !( (pCppStack - pCppStackStart ) & 3) && "UNALIGNED STACK !!! (Please DO panic)");
CPPU_CURRENT_NAMESPACE::callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr->eTypeClass,
(sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) );
try {
CPPU_CURRENT_NAMESPACE::callVirtualMethod(
pAdjustedThisPtr, aVtableSlot.index,
pCppReturn, pReturnTypeDescr->eTypeClass,
(sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) );
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;

View file

@ -17,8 +17,16 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <exception>
#include <malloc.h>
#include <typeinfo>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/genfunc.hxx>
#include <o3tl/runtimetooustring.hxx>
#include <uno/data.h>
#include "bridge.hxx"
@ -390,13 +398,23 @@ static void cpp_call(
if( nStackLongs & 1 )
// stack has to be 8 byte aligned
nStackLongs++;
callVirtualMethod(
pAdjustedThisPtr,
aVtableSlot.index,
pCppReturn,
pReturnTypeDescr->eTypeClass,
(sal_Int32 *)pCppStackStart,
nStackLongs);
try {
callVirtualMethod(
pAdjustedThisPtr,
aVtableSlot.index,
pCppReturn,
pReturnTypeDescr->eTypeClass,
(sal_Int32 *)pCppStackStart,
nStackLongs);
} catch (css::uno::Exception &) {
throw;
} catch (std::exception & e) {
throw css::uno::RuntimeException(
"C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": "
+ o3tl::runtimeToOUString(e.what()));
} catch (...) {
throw css::uno::RuntimeException("C++ code threw unknown exception");
}
// NO exception occurred...
*ppUnoExc = 0;