diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-09-18 00:18:33 +0300 |
---|---|---|
committer | Arkadiy Illarionov <qarkai@gmail.com> | 2019-09-18 14:40:48 +0200 |
commit | 8e53efa926bc05d73c48579f63c3d662a96bd35e (patch) | |
tree | 1390a88298fe70cc0e9c3b16a97e5476f07b73d4 /pyuno/source/module/pyuno.cxx | |
parent | eef2795aa105ae52607cc158504c455da87dfd2a (diff) |
tdf#39593 use getUnoTunnelImplementation in pyuno
Change-Id: I2cbbaad921b0a3d2ea6def4da2a2527dc4d94549
Reviewed-on: https://gerrit.libreoffice.org/79075
Tested-by: Jenkins
Reviewed-by: Arkadiy Illarionov <qarkai@gmail.com>
Diffstat (limited to 'pyuno/source/module/pyuno.cxx')
-rw-r--r-- | pyuno/source/module/pyuno.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx index a4d0ddc4e314..d9c9dacbb3fd 100644 --- a/pyuno/source/module/pyuno.cxx +++ b/pyuno/source/module/pyuno.cxx @@ -41,6 +41,7 @@ #include <com/sun/star/script/XInvocation2.hpp> #include <com/sun/star/script/XTypeConverter.hpp> #include <com/sun/star/lang/XSingleServiceFactory.hpp> +#include <comphelper/servicehelper.hxx> #include "pyuno_impl.hxx" @@ -1711,14 +1712,10 @@ PyRef PyUNO_new ( xInvocation.set( ssf->createInstanceWithArguments( Sequence<Any>( &targetInterface, 1 ) ), css::uno::UNO_QUERY_THROW ); - Reference<XUnoTunnel> xUnoTunnel ( - xInvocation->getIntrospection()->queryAdapter(cppu::UnoType<XUnoTunnel>::get()), UNO_QUERY ); - if( xUnoTunnel.is() ) - { - sal_Int64 that = xUnoTunnel->getSomething( ::pyuno::Adapter::getUnoTunnelImplementationId() ); - if( that ) - return reinterpret_cast<Adapter*>(that)->getWrappedObject(); - } + auto that = comphelper::getUnoTunnelImplementation<Adapter>( + xInvocation->getIntrospection()->queryAdapter(cppu::UnoType<XUnoTunnel>::get())); + if( that ) + return that->getWrappedObject(); } if( !Py_IsInitialized() ) throw RuntimeException(); |