diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2003-12-17 17:46:15 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2003-12-17 17:46:15 +0000 |
commit | 896abc29b61fccfbf5418a02d73400132edd3a88 (patch) | |
tree | b26733ee76f97081efc823204f66de605875eeb0 /pyuno | |
parent | 351125bb825a5885e65d18dead29d413a7313137 (diff) |
INTEGRATION: CWS geordi2q11 (1.3.26); FILE MERGED
2003/12/16 14:04:29 hr 1.3.26.1: #111934#: join CWS ooo111fix1
Diffstat (limited to 'pyuno')
-rw-r--r-- | pyuno/source/module/pyuno_adapter.cxx | 56 |
1 files changed, 6 insertions, 50 deletions
diff --git a/pyuno/source/module/pyuno_adapter.cxx b/pyuno/source/module/pyuno_adapter.cxx index ad4d9c3ba836..f201ef491afb 100644 --- a/pyuno/source/module/pyuno_adapter.cxx +++ b/pyuno/source/module/pyuno_adapter.cxx @@ -2,9 +2,9 @@ * * $RCSfile: pyuno_adapter.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: vg $ $Date: 2003-07-02 15:18:38 $ + * last change: $Author: vg $ $Date: 2003-12-17 18:46:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -128,54 +128,10 @@ void raiseInvocationTargetExceptionWhenNeeded( const Runtime &runtime ) { PyRef excType, excValue, excTraceback; PyErr_Fetch( (PyObject **)&excType, (PyObject**)&excValue,(PyObject**)&excTraceback); - Any unoExc; - - PyRef str; - if( excTraceback.is() ) - { - PyRef extractTraceback( - PyDict_GetItemString( - runtime.getImpl()->cargo->dictUnoModule.get(), - "_uno_extract_printable_stacktrace" ) ); - if( extractTraceback.is() ) - { - PyRef args( PyTuple_New( 1), SAL_NO_ACQUIRE ); - PyTuple_SetItem( args.get(), 0, excTraceback.getAcquired() ); - str = PyRef( PyObject_CallObject( extractTraceback.get(),args.get() ), SAL_NO_ACQUIRE); - } - else - { - str = PyRef( PyString_FromString( "Couldn't find uno._uno_extract_printable_stacktrace" ), - SAL_NO_ACQUIRE ); - } - } - else - { - // it may occur, that no traceback is given (e.g. only native code below) - str = PyRef( PyString_FromString( "no traceback available" ), SAL_NO_ACQUIRE); - } - - if( isInstanceOfStructOrException( runtime, excValue.get() ) ) - { - unoExc = runtime.pyObject2Any( excValue ); - } - else - { - OUStringBuffer buf; - PyRef typeName( PyObject_Str( excType.get() ), SAL_NO_ACQUIRE ); - buf.appendAscii( PyString_AsString( typeName.get() ) ); - buf.appendAscii( ": " ); - PyRef valueRep( PyObject_Str( excValue.get() ), SAL_NO_ACQUIRE ); - buf.appendAscii( PyString_AsString( valueRep.get())).appendAscii( ", traceback follows\n" ); - buf.appendAscii( PyString_AsString( str.get() ) ); - RuntimeException e; - e.Message = buf.makeStringAndClear(); - unoExc = makeAny( e ); - } - com::sun::star::uno::Exception e; - unoExc >>= e; - throw InvocationTargetException(((com::sun::star::uno::Exception*)unoExc.getValue())->Message, - Reference<XInterface>(), unoExc ); + Any unoExc( runtime.extractUnoException( excType, excValue, excTraceback ) ); + throw InvocationTargetException( + ((com::sun::star::uno::Exception*)unoExc.getValue())->Message, + Reference<XInterface>(), unoExc ); } } |