summaryrefslogtreecommitdiffstats
path: root/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-04-10 10:06:23 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-04-10 13:16:23 +0200
commit4544713d3ae7a83d45047b65bf7ba520b3e8762e (patch)
treee3fec7e6c16ad7481075222a6bf9e389a8e01af3 /bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx
parentcrashtesting: failure on loading ooo38880-1.doc (diff)
downloadcore-4544713d3ae7a83d45047b65bf7ba520b3e8762e.tar.gz
core-4544713d3ae7a83d45047b65bf7ba520b3e8762e.zip
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>
Diffstat (limited to 'bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx')
-rw-r--r--bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx24
1 files changed, 20 insertions, 4 deletions
diff --git a/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx
index a94e339d632a..7ad7d1955a44 100644
--- a/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx
@@ -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;