diff options
author | Noel Grandin <noel@peralex.com> | 2012-10-12 11:44:23 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-23 13:06:14 +0200 |
commit | b30ee83058793ea8fbb020e5ac8f118bd20853d5 (patch) | |
tree | c187507f36c6288e5f4ede78a0d5e33876f7b3f1 /scripting/source/vbaevents | |
parent | 5e48667f6bdd2f5e05b3f41d080fda06bd3d7c16 (diff) |
fdo#46808, use service constructor for beans::Introspection
Change-Id: Ieb49277020d31779979d8eb508391d6f8b97bf94
Diffstat (limited to 'scripting/source/vbaevents')
-rw-r--r-- | scripting/source/vbaevents/eventhelper.cxx | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx index ef33f8c5172f..ee1768af053d 100644 --- a/scripting/source/vbaevents/eventhelper.cxx +++ b/scripting/source/vbaevents/eventhelper.cxx @@ -26,7 +26,7 @@ #include <ooo/vba/XVBAToOOEventDescGen.hpp> #include <com/sun/star/beans/XPropertySet.hpp> -#include <com/sun/star/beans/XIntrospection.hpp> +#include <com/sun/star/beans/Introspection.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/lang/XMultiComponentFactory.hpp> @@ -376,40 +376,28 @@ ScriptEventHelper::ScriptEventHelper( const Reference< XInterface >& xControl ): Sequence< rtl::OUString > ScriptEventHelper::getEventListeners() { - Reference< lang::XMultiComponentFactory > xMFac( - m_xCtx->getServiceManager(), UNO_QUERY ); std::list< rtl::OUString > eventMethods; - if ( xMFac.is() ) - { - Reference< beans::XIntrospection > xIntrospection( - xMFac->createInstanceWithContext( rtl::OUString( - "com.sun.star.beans.Introspection" ), m_xCtx ), UNO_QUERY ); + Reference< beans::XIntrospection > xIntrospection = beans::Introspection::create( m_xCtx ); - Reference< beans::XIntrospectionAccess > xIntrospectionAccess; - if ( xIntrospection.is() ) + Reference< beans::XIntrospectionAccess > xIntrospectionAccess = + xIntrospection->inspect( makeAny( m_xControl ) ); + Sequence< Type > aControlListeners = + xIntrospectionAccess->getSupportedListeners(); + sal_Int32 nLength = aControlListeners.getLength(); + for ( sal_Int32 i = 0; i< nLength; ++i ) { - xIntrospectionAccess = xIntrospection->inspect( - makeAny( m_xControl ) ); - Sequence< Type > aControlListeners = - xIntrospectionAccess->getSupportedListeners(); - sal_Int32 nLength = aControlListeners.getLength(); - for ( sal_Int32 i = 0; i< nLength; ++i ) - { - Type& listType = aControlListeners[ i ]; - rtl::OUString sFullTypeName = listType.getTypeName(); - Sequence< ::rtl::OUString > sMeths = - comphelper::getEventMethodsForType( listType ); - sal_Int32 sMethLen = sMeths.getLength(); - for ( sal_Int32 j=0 ; j < sMethLen; ++j ) - { - rtl::OUString sEventMethod = sFullTypeName; - sEventMethod += DELIM; - sEventMethod += sMeths[ j ]; - eventMethods.push_back( sEventMethod ); - } - } - + Type& listType = aControlListeners[ i ]; + rtl::OUString sFullTypeName = listType.getTypeName(); + Sequence< ::rtl::OUString > sMeths = + comphelper::getEventMethodsForType( listType ); + sal_Int32 sMethLen = sMeths.getLength(); + for ( sal_Int32 j=0 ; j < sMethLen; ++j ) + { + rtl::OUString sEventMethod = sFullTypeName; + sEventMethod += DELIM; + sEventMethod += sMeths[ j ]; + eventMethods.push_back( sEventMethod ); } } |