diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-22 08:50:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-22 13:48:25 +0200 |
commit | a7ce8404befaf59df5f1a476c8dd414633bbf823 (patch) | |
tree | dc617344e2ac5a1b144614421a87d27a17ee0f36 /pyuno/source/module/pyuno_runtime.cxx | |
parent | 5c54b6523f74db4f79540361fc1630aaee06bcd5 (diff) |
loplugin:flatten in pyuno..sc
Change-Id: I7ddc0b76532d26910f78642200750459508c2861
Reviewed-on: https://gerrit.libreoffice.org/42617
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'pyuno/source/module/pyuno_runtime.cxx')
-rw-r--r-- | pyuno/source/module/pyuno_runtime.cxx | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx index 1a47db8999bd..0955326f61fc 100644 --- a/pyuno/source/module/pyuno_runtime.cxx +++ b/pyuno/source/module/pyuno_runtime.cxx @@ -764,13 +764,14 @@ Any Runtime::pyObject2Any ( const PyRef & source, enum ConversionMode mode ) con PyRef struc(PyObject_GetAttrString( o , "value" ),SAL_NO_ACQUIRE); PyUNO * obj = reinterpret_cast<PyUNO*>(struc.get()); Reference< XMaterialHolder > holder( obj->members->xInvocation, UNO_QUERY ); - if( holder.is( ) ) - a = holder->getMaterial(); - else + if( !holder.is( ) ) { throw RuntimeException( "struct or exception wrapper does not support XMaterialHolder" ); } + + a = holder->getMaterial(); + } else if( PyObject_IsInstance( o, getPyUnoClass().get() ) ) { @@ -789,28 +790,27 @@ Any Runtime::pyObject2Any ( const PyRef & source, enum ConversionMode mode ) con } else if( PyObject_IsInstance( o, getAnyClass( runtime ).get() ) ) { - if( ACCEPT_UNO_ANY == mode ) - { - a = pyObject2Any( PyRef( PyObject_GetAttrString( o , "value" ), SAL_NO_ACQUIRE) ); - Type t; - pyObject2Any( PyRef( PyObject_GetAttrString( o, "type" ), SAL_NO_ACQUIRE ) ) >>= t; - - try - { - a = getImpl()->cargo->xTypeConverter->convertTo( a, t ); - } - catch( const css::uno::Exception & e ) - { - throw WrappedTargetRuntimeException( - e.Message, e.Context, makeAny(e)); - } - } - else + if( !(ACCEPT_UNO_ANY == mode) ) { throw RuntimeException( "uno.Any instance not accepted during method call, " "use uno.invoke instead" ); } + + a = pyObject2Any( PyRef( PyObject_GetAttrString( o , "value" ), SAL_NO_ACQUIRE) ); + Type t; + pyObject2Any( PyRef( PyObject_GetAttrString( o, "type" ), SAL_NO_ACQUIRE ) ) >>= t; + + try + { + a = getImpl()->cargo->xTypeConverter->convertTo( a, t ); + } + catch( const css::uno::Exception & e ) + { + throw WrappedTargetRuntimeException( + e.Message, e.Context, makeAny(e)); + } + } else { |