diff options
-rw-r--r-- | pyuno/source/module/pyuno.cxx | 4 | ||||
-rw-r--r-- | pyuno/source/module/pyuno_runtime.cxx | 15 | ||||
-rw-r--r-- | pyuno/source/module/pyuno_struct.cxx | 5 |
3 files changed, 5 insertions, 19 deletions
diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx index e94309def148..473df58e1972 100644 --- a/pyuno/source/module/pyuno.cxx +++ b/pyuno/source/module/pyuno.cxx @@ -1709,9 +1709,7 @@ PyRef PyUNO_new ( { PyThreadDetach antiguard; xInvocation.set( - ssf->createInstanceWithArguments( Sequence<Any>( &targetInterface, 1 ) ), UNO_QUERY ); - if( !xInvocation.is() ) - throw RuntimeException("XInvocation2 not implemented, cannot interact with object"); + ssf->createInstanceWithArguments( Sequence<Any>( &targetInterface, 1 ) ), css::uno::UNO_QUERY_THROW ); Reference<XUnoTunnel> xUnoTunnel ( xInvocation->getIntrospection()->queryAdapter(cppu::UnoType<XUnoTunnel>::get()), UNO_QUERY ); diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx index b14cbde39a57..755a6dc46a75 100644 --- a/pyuno/source/module/pyuno_runtime.cxx +++ b/pyuno/source/module/pyuno_runtime.cxx @@ -267,9 +267,7 @@ PyRef stRuntimeImpl::create( const Reference< XComponentContext > &ctx ) ctx->getServiceManager()->createInstanceWithContext( "com.sun.star.script.Invocation", ctx ), - UNO_QUERY ); - if( ! c->xInvocation.is() ) - throw RuntimeException( "pyuno: couldn't instantiate invocation service" ); + css::uno::UNO_QUERY_THROW ); c->xTypeConverter = Converter::create(ctx); if( ! c->xTypeConverter.is() ) @@ -792,15 +790,8 @@ Any Runtime::pyObject2Any ( const PyRef & source, enum ConversionMode mode ) con else if( PyObject_IsInstance( o, getPyUnoStructClass().get() ) ) { PyUNO* o_pi = reinterpret_cast<PyUNO*>(o); - Reference<XMaterialHolder> my_mh (o_pi->members->xInvocation, UNO_QUERY); - - if (!my_mh.is()) - { - throw RuntimeException( - "struct wrapper does not support XMaterialHolder" ); - } - else - a = my_mh->getMaterial(); + Reference<XMaterialHolder> my_mh (o_pi->members->xInvocation, css::uno::UNO_QUERY_THROW); + a = my_mh->getMaterial(); } else if( PyObject_IsInstance( o, getCharClass( runtime ).get() ) ) { diff --git a/pyuno/source/module/pyuno_struct.cxx b/pyuno/source/module/pyuno_struct.cxx index 437b4a8f1614..be8e0b913807 100644 --- a/pyuno/source/module/pyuno_struct.cxx +++ b/pyuno/source/module/pyuno_struct.cxx @@ -368,10 +368,7 @@ PyRef PyUNOStruct_new ( { PyThreadDetach antiguard; xInvocation.set( - ssf->createInstanceWithArguments( Sequence<Any>( &targetInterface, 1 ) ), UNO_QUERY ); - OSL_ASSERT( xInvocation.is() ); - if( !xInvocation.is() ) - throw RuntimeException("XInvocation2 not implemented, cannot interact with object"); + ssf->createInstanceWithArguments( Sequence<Any>( &targetInterface, 1 ) ), css::uno::UNO_QUERY_THROW ); } if( !Py_IsInitialized() ) throw RuntimeException(); |