[Libreoffice-commits] .: basic/source binfilter comphelper/inc comphelper/source eventattacher/source extensions/source forms/source pyuno/source reportdesign/source scripting/source sc/source stoc/source svx/source vbahelper/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Oct 23 04:07:01 PDT 2012


 basic/source/classes/sbunoobj.cxx                       |   15 
 binfilter                                               |    2 
 comphelper/inc/comphelper/eventattachermgr.hxx          |    6 
 comphelper/source/eventattachermgr/eventattachermgr.cxx |   17 
 eventattacher/source/eventattacher.cxx                  |    5 
 extensions/source/propctrlr/eventhandler.cxx            |    5 
 extensions/source/propctrlr/genericpropertyhandler.cxx  |    6 
 forms/source/misc/InterfaceContainer.cxx                |    4 
 pyuno/source/module/pyuno_runtime.cxx                   |   12 
 reportdesign/source/core/sdr/UndoEnv.cxx                |   16 
 sc/source/core/tool/addincol.cxx                        |  548 +++++++---------
 sc/source/ui/vba/vbahelper.cxx                          |    6 
 scripting/source/dlgprov/dlgprov.cxx                    |   36 -
 scripting/source/vbaevents/eventhelper.cxx              |   50 -
 stoc/source/invocation/invocation.cxx                   |    8 
 svx/source/form/fmshimp.cxx                             |   10 
 vbahelper/source/vbahelper/vbahelper.cxx                |    6 
 17 files changed, 339 insertions(+), 413 deletions(-)

New commits:
commit b30ee83058793ea8fbb020e5ac8f118bd20853d5
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Oct 12 11:44:23 2012 +0200

    fdo#46808, use service constructor for beans::Introspection
    
    Change-Id: Ieb49277020d31779979d8eb508391d6f8b97bf94

diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index cd43e1b..6b635aa 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -47,6 +47,7 @@
 #include <com/sun/star/beans/PropertyConcept.hpp>
 #include <com/sun/star/beans/MethodConcept.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/beans/Introspection.hpp>
 #include <com/sun/star/script/BasicErrorException.hpp>
 #include <com/sun/star/script/XAllListener.hpp>
 #include <com/sun/star/script/XInvocationAdapterFactory.hpp>
@@ -2421,18 +2422,8 @@ void SbUnoObject::doIntrospection( void )
     if( !xIntrospection.is() )
     {
         // get the introspection service
-        Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
-        if ( xFactory.is() )
-        {
-            Reference< XInterface > xI = xFactory->createInstance( rtl::OUString("com.sun.star.beans.Introspection") );
-            if (xI.is())
-                xIntrospection = Reference< XIntrospection >::query( xI );
-        }
-    }
-    if( !xIntrospection.is() )
-    {
-        StarBASIC::FatalError( ERRCODE_BASIC_EXCEPTION );
-        return;
+        Reference< XComponentContext > xContext( comphelper::getProcessComponentContext() );
+        xIntrospection = Introspection::create( xContext );
     }
 
     // pass the introspection
diff --git a/binfilter b/binfilter
index ab3e097..5945161 160000
--- a/binfilter
+++ b/binfilter
@@ -1 +1 @@
-Subproject commit ab3e0975e1bf8d662e7d154de9313a491dc02b31
+Subproject commit 5945161bdfa46e76ca911fea2dc937f9fe95b074
diff --git a/comphelper/inc/comphelper/eventattachermgr.hxx b/comphelper/inc/comphelper/eventattachermgr.hxx
index 2366dc6..a525e7c 100644
--- a/comphelper/inc/comphelper/eventattachermgr.hxx
+++ b/comphelper/inc/comphelper/eventattachermgr.hxx
@@ -26,9 +26,7 @@
 namespace com { namespace sun { namespace star {
 namespace uno {
     class Exception;
-}
-namespace lang {
-    class XMultiServiceFactory;
+    class XComponentContext;
 }
 namespace script {
     class XEventAttacherManager;
@@ -44,7 +42,7 @@ namespace comphelper
 
 COMPHELPER_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::script::XEventAttacherManager >
 createEventAttacherManager(
-        const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr )
+        const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext )
     throw( ::com::sun::star::uno::Exception );
 
 }
diff --git a/comphelper/source/eventattachermgr/eventattachermgr.cxx b/comphelper/source/eventattachermgr/eventattachermgr.cxx
index 85ed313..32ab389 100644
--- a/comphelper/source/eventattachermgr/eventattachermgr.cxx
+++ b/comphelper/source/eventattachermgr/eventattachermgr.cxx
@@ -25,7 +25,7 @@
 #include <osl/diagnose.h>
 #include <comphelper/eventattachermgr.hxx>
 #include <comphelper/processfactory.hxx>
-#include <com/sun/star/beans/XIntrospection.hpp>
+#include <com/sun/star/beans/Introspection.hpp>
 #include <com/sun/star/io/XObjectInputStream.hpp>
 #include <com/sun/star/io/XPersistObject.hpp>
 #include <com/sun/star/io/XObjectOutputStream.hpp>
@@ -353,20 +353,11 @@ void SAL_CALL AttacherAllListener_Impl::disposing(const EventObject& )
 
 
 // Constructor method for EventAttacherManager
-Reference< XEventAttacherManager > createEventAttacherManager( const Reference< XMultiServiceFactory > & rSMgr )
+Reference< XEventAttacherManager > createEventAttacherManager( const Reference< XComponentContext > & rxContext )
     throw( Exception )
 {
-    if ( rSMgr.is() )
-    {
-        Reference< XInterface > xIFace( rSMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.beans.Introspection" )) ) );
-        if ( xIFace.is() )
-        {
-            Reference< XIntrospection > xIntrospection( xIFace, UNO_QUERY);
-            return new ImplEventAttacherManager( xIntrospection, comphelper::getComponentContext(rSMgr) );
-        }
-    }
-
-    return Reference< XEventAttacherManager >();
+    Reference< XIntrospection > xIntrospection = Introspection::create( rxContext );
+    return new ImplEventAttacherManager( xIntrospection, rxContext );
 }
 
 //-----------------------------------------------------------------------------
diff --git a/eventattacher/source/eventattacher.cxx b/eventattacher/source/eventattacher.cxx
index 3b22b49..e6c97bd 100644
--- a/eventattacher/source/eventattacher.cxx
+++ b/eventattacher/source/eventattacher.cxx
@@ -22,7 +22,7 @@
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
 #include <com/sun/star/registry/XRegistryKey.hpp>
-#include <com/sun/star/beans/XIntrospection.hpp>
+#include <com/sun/star/beans/Introspection.hpp>
 #include <com/sun/star/beans/MethodConcept.hpp>
 #include <com/sun/star/script/XEventAttacher2.hpp>
 #include <com/sun/star/script/Converter.hpp>
@@ -395,8 +395,7 @@ Reference< XIntrospection > EventAttacherImpl::getIntrospection() throw( Excepti
     Guard< Mutex > aGuard( m_aMutex );
     if( !m_xIntrospection.is() )
     {
-        Reference< XInterface > xIFace( m_xSMgr->createInstance( rtl::OUString("com.sun.star.beans.Introspection") ) );
-        m_xIntrospection = Reference< XIntrospection >( xIFace, UNO_QUERY );
+        m_xIntrospection = Introspection::create( comphelper::getComponentContext(m_xSMgr) );
     }
     return m_xIntrospection;
 }
diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx
index f7a6862..1116c7a 100644
--- a/extensions/source/propctrlr/eventhandler.cxx
+++ b/extensions/source/propctrlr/eventhandler.cxx
@@ -41,7 +41,7 @@
 #include <com/sun/star/awt/XTabControllerModel.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/beans/UnknownPropertyException.hpp>
-#include <com/sun/star/beans/XIntrospection.hpp>
+#include <com/sun/star/beans/Introspection.hpp>
 #include <com/sun/star/beans/XIntrospectionAccess.hpp>
 #include <com/sun/star/container/NoSuchElementException.hpp>
 #include <com/sun/star/container/XChild.hpp>
@@ -95,6 +95,7 @@ namespace pcr
     using ::com::sun::star::uno::Any;
     using ::com::sun::star::uno::TypeClass_STRING;
     using ::com::sun::star::uno::Type;
+    using ::com::sun::star::beans::Introspection;
     using ::com::sun::star::beans::XPropertyChangeListener;
     using ::com::sun::star::beans::Property;
     using ::com::sun::star::beans::PropertyState;
@@ -1060,7 +1061,7 @@ namespace pcr
             // we use a set to avoid duplicates
             TypeBag aListeners;
 
-            Reference< XIntrospection > xIntrospection( m_aContext.createComponent( "com.sun.star.beans.Introspection" ), UNO_QUERY_THROW );
+            Reference< XIntrospection > xIntrospection = Introspection::create( m_aContext.getUNOContext() );
 
             // --- model listeners
             lcl_addListenerTypesFor_throw(
diff --git a/extensions/source/propctrlr/genericpropertyhandler.cxx b/extensions/source/propctrlr/genericpropertyhandler.cxx
index 3a06449..071b437 100644
--- a/extensions/source/propctrlr/genericpropertyhandler.cxx
+++ b/extensions/source/propctrlr/genericpropertyhandler.cxx
@@ -32,7 +32,7 @@
 
 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
 #include <com/sun/star/reflection/XEnumTypeDescription.hpp>
-#include <com/sun/star/beans/XIntrospection.hpp>
+#include <com/sun/star/beans/Introspection.hpp>
 #include <com/sun/star/inspection/PropertyControlType.hpp>
 #include <com/sun/star/inspection/XHyperlinkControl.hpp>
 #include <com/sun/star/awt/XActionListener.hpp>
@@ -384,9 +384,7 @@ namespace pcr
         m_xPropertyState.clear();
 
         // create an introspection adapter for the component
-        Reference< XIntrospection > xIntrospection;
-        if ( !m_aContext.createComponent( "com.sun.star.beans.Introspection", xIntrospection ) )
-            throw RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Could not create an instance of the service com.sun.star.beans.Introspection." ) ), *this );
+        Reference< XIntrospection > xIntrospection = Introspection::create( m_aContext.getUNOContext() );
 
         Reference< XIntrospectionAccess > xIntrospectionAccess( xIntrospection->inspect( makeAny( _rxIntrospectee ) ) );
         if ( !xIntrospectionAccess.is() )
diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx
index 0965b2b..f10a32d 100644
--- a/forms/source/misc/InterfaceContainer.cxx
+++ b/forms/source/misc/InterfaceContainer.cxx
@@ -244,7 +244,7 @@ void OInterfaceContainer::impl_createEventAttacher_nothrow()
 {
     try
     {
-        m_xEventAttacher.set( ::comphelper::createEventAttacherManager( m_xServiceFactory ), UNO_SET_THROW );
+        m_xEventAttacher.set( ::comphelper::createEventAttacherManager( comphelper::getComponentContext(m_xServiceFactory) ), UNO_SET_THROW );
     }
     catch( const Exception& )
     {
@@ -621,7 +621,7 @@ void SAL_CALL OInterfaceContainer::read( const Reference< XObjectInputStream >&
     {
         try
         {
-            m_xEventAttacher = ::comphelper::createEventAttacherManager( m_xServiceFactory );
+            m_xEventAttacher = ::comphelper::createEventAttacherManager( comphelper::getComponentContext(m_xServiceFactory) );
             OSL_ENSURE( m_xEventAttacher.is(), "OInterfaceContainer::read: could not create an event attacher manager!" );
         }
         catch( const Exception& )
diff --git a/pyuno/source/module/pyuno_runtime.cxx b/pyuno/source/module/pyuno_runtime.cxx
index c61ae00..fdd3018 100644
--- a/pyuno/source/module/pyuno_runtime.cxx
+++ b/pyuno/source/module/pyuno_runtime.cxx
@@ -30,6 +30,7 @@
 #include <typelib/typedescription.hxx>
 
 #include <com/sun/star/beans/XMaterialHolder.hpp>
+#include <com/sun/star/beans/Introspection.hpp>
 #include <com/sun/star/script/Converter.hpp>
 #include <com/sun/star/reflection/theCoreReflection.hpp>
 
@@ -59,6 +60,7 @@ using com::sun::star::script::XInvocationAdapterFactory2;
 using com::sun::star::script::XInvocation;
 using com::sun::star::beans::XMaterialHolder;
 using com::sun::star::beans::XIntrospection;
+using com::sun::star::beans::Introspection;
 
 #include <vector>
 
@@ -278,15 +280,7 @@ PyRef stRuntimeImpl::create( const Reference< XComponentContext > &ctx )
             OUString(  "pyuno: couldn't instantiate invocation adapter factory service" ),
             Reference< XInterface > () );
 
-    c->xIntrospection = Reference< XIntrospection > (
-        ctx->getServiceManager()->createInstanceWithContext(
-            OUString(  "com.sun.star.beans.Introspection"  ),
-            ctx ),
-        UNO_QUERY );
-    if( ! c->xIntrospection.is() )
-        throw RuntimeException(
-            OUString(  "pyuno: couldn't instantiate introspection service" ),
-            Reference< XInterface > () );
+    c->xIntrospection = Introspection::create(ctx);
 
     Any a = ctx->getValueByName(OUString( "/singletons/com.sun.star.reflection.theTypeDescriptionManager" ) );
     a >>= c->xTdMgr;
diff --git a/reportdesign/source/core/sdr/UndoEnv.cxx b/reportdesign/source/core/sdr/UndoEnv.cxx
index 41c13e2..519e294 100644
--- a/reportdesign/source/core/sdr/UndoEnv.cxx
+++ b/reportdesign/source/core/sdr/UndoEnv.cxx
@@ -32,6 +32,7 @@
 #include <com/sun/star/script/XEventAttacherManager.hpp>
 #include <com/sun/star/container/XChild.hpp>
 #include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/beans/Introspection.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/util/XModifyBroadcaster.hpp>
 #include <com/sun/star/beans/XIntrospectionAccess.hpp>
@@ -277,16 +278,13 @@ void SAL_CALL OXUndoEnvironment::propertyChange( const PropertyChangeEvent& _rEv
                     if ( !m_pImpl->m_xIntrospection.is() )
                     {
                         ::comphelper::ComponentContext aContext( m_pImpl->m_rModel.getController()->getORB() );
-                        OSL_VERIFY( aContext.createComponent( "com.sun.star.beans.Introspection", m_pImpl->m_xIntrospection ) );
-                    }
-                    if ( m_pImpl->m_xIntrospection.is() )
-                    {
-                        Reference< XIntrospectionAccess > xIntrospection(
-                            m_pImpl->m_xIntrospection->inspect( makeAny( _rEvent.Source ) ),
-                            UNO_SET_THROW
-                        );
-                        rObjectInfo.xPropertyIntrospection.set( xIntrospection->queryAdapter( XPropertySet::static_type() ), UNO_QUERY_THROW );
+                        m_pImpl->m_xIntrospection = Introspection::create( aContext.getUNOContext() );
                     }
+                    Reference< XIntrospectionAccess > xIntrospection(
+                        m_pImpl->m_xIntrospection->inspect( makeAny( _rEvent.Source ) ),
+                        UNO_SET_THROW
+                    );
+                    rObjectInfo.xPropertyIntrospection.set( xIntrospection->queryAdapter( XPropertySet::static_type() ), UNO_QUERY_THROW );
                 }
                 if ( rObjectInfo.xPropertyIntrospection.is() )
                 {
diff --git a/sc/source/core/tool/addincol.cxx b/sc/source/core/tool/addincol.cxx
index 6736d74..4ca1cff 100644
--- a/sc/source/core/tool/addincol.cxx
+++ b/sc/source/core/tool/addincol.cxx
@@ -38,7 +38,7 @@
 #include <com/sun/star/lang/XSingleComponentFactory.hpp>
 #include <com/sun/star/reflection/XIdlClass.hpp>
 #include <com/sun/star/beans/XIntrospectionAccess.hpp>
-#include <com/sun/star/beans/XIntrospection.hpp>
+#include <com/sun/star/beans/Introspection.hpp>
 #include <com/sun/star/beans/MethodConcept.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/table/XCellRange.hpp>
@@ -800,216 +800,209 @@ void ScUnoAddInCollection::ReadFromAddIn( const uno::Reference<uno::XInterface>&
 
         //! pass XIntrospection to ReadFromAddIn
 
-        uno::Reference<lang::XMultiServiceFactory> xManager = comphelper::getProcessServiceFactory();
-        if ( xManager.is() )
+        uno::Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext();
+
+        uno::Reference<beans::XIntrospection> xIntro = beans::Introspection::create( xContext );
+        uno::Any aObject;
+        aObject <<= xAddIn;
+        uno::Reference<beans::XIntrospectionAccess> xAcc = xIntro->inspect(aObject);
+        if (xAcc.is())
         {
-            uno::Reference<beans::XIntrospection> xIntro(
-                                    xManager->createInstance(rtl::OUString("com.sun.star.beans.Introspection")),
-                                    uno::UNO_QUERY );
-            if ( xIntro.is() )
+            uno::Sequence< uno::Reference<reflection::XIdlMethod> > aMethods =
+                    xAcc->getMethods( beans::MethodConcept::ALL );
+            long nNewCount = aMethods.getLength();
+            if ( nNewCount )
             {
-                uno::Any aObject;
-                aObject <<= xAddIn;
-                uno::Reference<beans::XIntrospectionAccess> xAcc = xIntro->inspect(aObject);
-                if (xAcc.is())
+                long nOld = nFuncCount;
+                nFuncCount = nNewCount+nOld;
+                if ( nOld )
+                {
+                    ScUnoAddInFuncData** ppNew = new ScUnoAddInFuncData*[nFuncCount];
+                    for (long i=0; i<nOld; i++)
+                        ppNew[i] = ppFuncData[i];
+                    delete[] ppFuncData;
+                    ppFuncData = ppNew;
+                }
+                else
+                    ppFuncData = new ScUnoAddInFuncData*[nFuncCount];
+
+                //! TODO: adjust bucket count?
+                if ( !pExactHashMap )
+                    pExactHashMap = new ScAddInHashMap;
+                if ( !pNameHashMap )
+                    pNameHashMap = new ScAddInHashMap;
+                if ( !pLocalHashMap )
+                    pLocalHashMap = new ScAddInHashMap;
+
+                const uno::Reference<reflection::XIdlMethod>* pArray = aMethods.getConstArray();
+                for (long nFuncPos=0; nFuncPos<nNewCount; nFuncPos++)
                 {
-                    uno::Sequence< uno::Reference<reflection::XIdlMethod> > aMethods =
-                            xAcc->getMethods( beans::MethodConcept::ALL );
-                    long nNewCount = aMethods.getLength();
-                    if ( nNewCount )
+                    ppFuncData[nFuncPos+nOld] = NULL;
+
+                    uno::Reference<reflection::XIdlMethod> xFunc = pArray[nFuncPos];
+                    if (xFunc.is())
                     {
-                        long nOld = nFuncCount;
-                        nFuncCount = nNewCount+nOld;
-                        if ( nOld )
+                        //  leave out internal functions
+                        uno::Reference<reflection::XIdlClass> xClass =
+                                        xFunc->getDeclaringClass();
+                        sal_Bool bSkip = sal_True;
+                        if ( xClass.is() )
                         {
-                            ScUnoAddInFuncData** ppNew = new ScUnoAddInFuncData*[nFuncCount];
-                            for (long i=0; i<nOld; i++)
-                                ppNew[i] = ppFuncData[i];
-                            delete[] ppFuncData;
-                            ppFuncData = ppNew;
+                            //! XIdlClass needs getType() method!
+                            rtl::OUString sName = xClass->getName();
+                            bSkip = (
+                                IsTypeName( sName,
+                                    getCppuType((uno::Reference<uno::XInterface>*)0) ) ||
+                                IsTypeName( sName,
+                                    getCppuType((uno::Reference<lang::XServiceName>*)0) ) ||
+                                IsTypeName( sName,
+                                    getCppuType((uno::Reference<lang::XServiceInfo>*)0) ) ||
+                                IsTypeName( sName,
+                                    getCppuType((uno::Reference<sheet::XAddIn>*)0) ) );
                         }
-                        else
-                            ppFuncData = new ScUnoAddInFuncData*[nFuncCount];
-
-                        //! TODO: adjust bucket count?
-                        if ( !pExactHashMap )
-                            pExactHashMap = new ScAddInHashMap;
-                        if ( !pNameHashMap )
-                            pNameHashMap = new ScAddInHashMap;
-                        if ( !pLocalHashMap )
-                            pLocalHashMap = new ScAddInHashMap;
-
-                        const uno::Reference<reflection::XIdlMethod>* pArray = aMethods.getConstArray();
-                        for (long nFuncPos=0; nFuncPos<nNewCount; nFuncPos++)
+                        if (!bSkip)
                         {
-                            ppFuncData[nFuncPos+nOld] = NULL;
+                            uno::Reference<reflection::XIdlClass> xReturn =
+                                        xFunc->getReturnType();
+                            if ( !lcl_ValidReturnType( xReturn ) )
+                                bSkip = sal_True;
+                        }
+                        if (!bSkip)
+                        {
+                            rtl::OUString aFuncU = xFunc->getName();
+
+                            // stored function name: (service name).(function)
+                            rtl::OUStringBuffer aFuncNameBuffer( aServiceName.getLength()+1+aFuncU.getLength());
+                            aFuncNameBuffer.append(aServiceName);
+                            aFuncNameBuffer.append('.');
+                            aFuncNameBuffer.append(aFuncU);
+                            rtl::OUString aFuncName = aFuncNameBuffer.makeStringAndClear();
 
-                            uno::Reference<reflection::XIdlMethod> xFunc = pArray[nFuncPos];
-                            if (xFunc.is())
+                            sal_Bool bValid = sal_True;
+                            long nVisibleCount = 0;
+                            long nCallerPos = SC_CALLERPOS_NONE;
+
+                            uno::Sequence<reflection::ParamInfo> aParams =
+                                    xFunc->getParameterInfos();
+                            long nParamCount = aParams.getLength();
+                            const reflection::ParamInfo* pParArr = aParams.getConstArray();
+                            long nParamPos;
+                            for (nParamPos=0; nParamPos<nParamCount; nParamPos++)
                             {
-                                //  leave out internal functions
-                                uno::Reference<reflection::XIdlClass> xClass =
-                                                xFunc->getDeclaringClass();
-                                sal_Bool bSkip = sal_True;
-                                if ( xClass.is() )
+                                if ( pParArr[nParamPos].aMode != reflection::ParamMode_IN )
+                                    bValid = false;
+                                uno::Reference<reflection::XIdlClass> xParClass =
+                                            pParArr[nParamPos].aType;
+                                ScAddInArgumentType eArgType = lcl_GetArgType( xParClass );
+                                if ( eArgType == SC_ADDINARG_NONE )
+                                    bValid = false;
+                                else if ( eArgType == SC_ADDINARG_CALLER )
+                                    nCallerPos = nParamPos;
+                                else
+                                    ++nVisibleCount;
+                            }
+                            if (bValid)
+                            {
+                                sal_uInt16 nCategory = lcl_GetCategory(
+                                        xAddIn->getProgrammaticCategoryName( aFuncU ) );
+
+                                rtl::OString sHelpId = aHelpIdGenerator.GetHelpId( aFuncU );
+
+                                ::rtl::OUString aLocalName;
+                                try
+                                {
+                                    aLocalName = xAddIn->
+                                        getDisplayFunctionName( aFuncU );
+                                }
+                                catch(uno::Exception&)
+                                {
+                                    aLocalName = "###";
+                                }
+
+                                ::rtl::OUString aDescription;
+                                try
                                 {
-                                    //! XIdlClass needs getType() method!
-                                    rtl::OUString sName = xClass->getName();
-                                    bSkip = (
-                                        IsTypeName( sName,
-                                            getCppuType((uno::Reference<uno::XInterface>*)0) ) ||
-                                        IsTypeName( sName,
-                                            getCppuType((uno::Reference<lang::XServiceName>*)0) ) ||
-                                        IsTypeName( sName,
-                                            getCppuType((uno::Reference<lang::XServiceInfo>*)0) ) ||
-                                        IsTypeName( sName,
-                                            getCppuType((uno::Reference<sheet::XAddIn>*)0) ) );
+                                    aDescription = xAddIn->
+                                        getFunctionDescription( aFuncU );
                                 }
-                                if (!bSkip)
+                                catch(uno::Exception&)
                                 {
-                                    uno::Reference<reflection::XIdlClass> xReturn =
-                                                xFunc->getReturnType();
-                                    if ( !lcl_ValidReturnType( xReturn ) )
-                                        bSkip = sal_True;
+                                    aDescription = "###";
                                 }
-                                if (!bSkip)
+
+                                ScAddInArgDesc* pVisibleArgs = NULL;
+                                if ( nVisibleCount > 0 )
                                 {
-                                    rtl::OUString aFuncU = xFunc->getName();
-
-                                    // stored function name: (service name).(function)
-                                    rtl::OUStringBuffer aFuncNameBuffer( aServiceName.getLength()+1+aFuncU.getLength());
-                                    aFuncNameBuffer.append(aServiceName);
-                                    aFuncNameBuffer.append('.');
-                                    aFuncNameBuffer.append(aFuncU);
-                                    rtl::OUString aFuncName = aFuncNameBuffer.makeStringAndClear();
-
-                                    sal_Bool bValid = sal_True;
-                                    long nVisibleCount = 0;
-                                    long nCallerPos = SC_CALLERPOS_NONE;
-
-                                    uno::Sequence<reflection::ParamInfo> aParams =
-                                            xFunc->getParameterInfos();
-                                    long nParamCount = aParams.getLength();
-                                    const reflection::ParamInfo* pParArr = aParams.getConstArray();
-                                    long nParamPos;
+                                    ScAddInArgDesc aDesc;
+                                    pVisibleArgs = new ScAddInArgDesc[nVisibleCount];
+                                    long nDestPos = 0;
                                     for (nParamPos=0; nParamPos<nParamCount; nParamPos++)
                                     {
-                                        if ( pParArr[nParamPos].aMode != reflection::ParamMode_IN )
-                                            bValid = false;
                                         uno::Reference<reflection::XIdlClass> xParClass =
-                                                    pParArr[nParamPos].aType;
+                                            pParArr[nParamPos].aType;
                                         ScAddInArgumentType eArgType = lcl_GetArgType( xParClass );
-                                        if ( eArgType == SC_ADDINARG_NONE )
-                                            bValid = false;
-                                        else if ( eArgType == SC_ADDINARG_CALLER )
-                                            nCallerPos = nParamPos;
-                                        else
-                                            ++nVisibleCount;
-                                    }
-                                    if (bValid)
-                                    {
-                                        sal_uInt16 nCategory = lcl_GetCategory(
-                                                xAddIn->getProgrammaticCategoryName( aFuncU ) );
-
-                                        rtl::OString sHelpId = aHelpIdGenerator.GetHelpId( aFuncU );
-
-                                        ::rtl::OUString aLocalName;
-                                        try
-                                        {
-                                            aLocalName = xAddIn->
-                                                getDisplayFunctionName( aFuncU );
-                                        }
-                                        catch(uno::Exception&)
-                                        {
-                                            aLocalName = "###";
-                                        }
-
-                                        ::rtl::OUString aDescription;
-                                        try
-                                        {
-                                            aDescription = xAddIn->
-                                                getFunctionDescription( aFuncU );
-                                        }
-                                        catch(uno::Exception&)
-                                        {
-                                            aDescription = "###";
-                                        }
-
-                                        ScAddInArgDesc* pVisibleArgs = NULL;
-                                        if ( nVisibleCount > 0 )
+                                        if ( eArgType != SC_ADDINARG_CALLER )
                                         {
-                                            ScAddInArgDesc aDesc;
-                                            pVisibleArgs = new ScAddInArgDesc[nVisibleCount];
-                                            long nDestPos = 0;
-                                            for (nParamPos=0; nParamPos<nParamCount; nParamPos++)
+                                            rtl::OUString aArgName;
+                                            try
                                             {
-                                                uno::Reference<reflection::XIdlClass> xParClass =
-                                                    pParArr[nParamPos].aType;
-                                                ScAddInArgumentType eArgType = lcl_GetArgType( xParClass );
-                                                if ( eArgType != SC_ADDINARG_CALLER )
-                                                {
-                                                    rtl::OUString aArgName;
-                                                    try
-                                                    {
-                                                        aArgName = xAddIn->
-                                                            getDisplayArgumentName( aFuncU, nParamPos );
-                                                    }
-                                                    catch(uno::Exception&)
-                                                    {
-                                                        aArgName = "###";
-                                                    }
-                                                    rtl::OUString aArgDesc;
-                                                    try
-                                                    {
-                                                        aArgDesc = xAddIn->
-                                                            getArgumentDescription( aFuncU, nParamPos );
-                                                    }
-                                                    catch(uno::Exception&)
-                                                    {
-                                                        aArgName = "###";
-                                                    }
-
-                                                    sal_Bool bOptional =
-                                                        ( eArgType == SC_ADDINARG_VALUE_OR_ARRAY ||
-                                                          eArgType == SC_ADDINARG_VARARGS );
-
-                                                    aDesc.eType = eArgType;
-                                                    aDesc.aName = aArgName;
-                                                    aDesc.aDescription = aArgDesc;
-                                                    aDesc.bOptional = bOptional;
-                                                    //! initialize aInternalName only from config?
-                                                    aDesc.aInternalName = pParArr[nParamPos].aName;
-
-                                                    pVisibleArgs[nDestPos++] = aDesc;
-                                                }
+                                                aArgName = xAddIn->
+                                                    getDisplayArgumentName( aFuncU, nParamPos );
+                                            }
+                                            catch(uno::Exception&)
+                                            {
+                                                aArgName = "###";
+                                            }
+                                            rtl::OUString aArgDesc;
+                                            try
+                                            {
+                                                aArgDesc = xAddIn->
+                                                    getArgumentDescription( aFuncU, nParamPos );
+                                            }
+                                            catch(uno::Exception&)
+                                            {
+                                                aArgName = "###";
                                             }
-                                            OSL_ENSURE( nDestPos==nVisibleCount, "wrong count" );
-                                        }
 
-                                        ppFuncData[nFuncPos+nOld] = new ScUnoAddInFuncData(
-                                            aFuncName, aLocalName, aDescription,
-                                            nCategory, sHelpId,
-                                            xFunc, aObject,
-                                            nVisibleCount, pVisibleArgs, nCallerPos );
-
-                                        const ScUnoAddInFuncData* pData =
-                                            ppFuncData[nFuncPos+nOld];
-                                        pExactHashMap->insert(
-                                                ScAddInHashMap::value_type(
-                                                    pData->GetOriginalName(),
-                                                    pData ) );
-                                        pNameHashMap->insert(
-                                                ScAddInHashMap::value_type(
-                                                    pData->GetUpperName(),
-                                                    pData ) );
-                                        pLocalHashMap->insert(
-                                                ScAddInHashMap::value_type(
-                                                    pData->GetUpperLocal(),
-                                                    pData ) );
-
-                                        delete[] pVisibleArgs;
+                                            sal_Bool bOptional =
+                                                ( eArgType == SC_ADDINARG_VALUE_OR_ARRAY ||
+                                                  eArgType == SC_ADDINARG_VARARGS );
+
+                                            aDesc.eType = eArgType;
+                                            aDesc.aName = aArgName;
+                                            aDesc.aDescription = aArgDesc;
+                                            aDesc.bOptional = bOptional;
+                                            //! initialize aInternalName only from config?
+                                            aDesc.aInternalName = pParArr[nParamPos].aName;
+
+                                            pVisibleArgs[nDestPos++] = aDesc;
+                                        }
                                     }
+                                    OSL_ENSURE( nDestPos==nVisibleCount, "wrong count" );
                                 }
+
+                                ppFuncData[nFuncPos+nOld] = new ScUnoAddInFuncData(
+                                    aFuncName, aLocalName, aDescription,
+                                    nCategory, sHelpId,
+                                    xFunc, aObject,
+                                    nVisibleCount, pVisibleArgs, nCallerPos );
+
+                                const ScUnoAddInFuncData* pData =
+                                    ppFuncData[nFuncPos+nOld];
+                                pExactHashMap->insert(
+                                        ScAddInHashMap::value_type(
+                                            pData->GetOriginalName(),
+                                            pData ) );
+                                pNameHashMap->insert(
+                                        ScAddInHashMap::value_type(
+                                            pData->GetUpperName(),
+                                            pData ) );
+                                pLocalHashMap->insert(
+                                        ScAddInHashMap::value_type(
+                                            pData->GetUpperLocal(),
+                                            pData ) );
+
+                                delete[] pVisibleArgs;
                             }
                         }
                     }
@@ -1066,119 +1059,112 @@ void ScUnoAddInCollection::UpdateFromAddIn( const uno::Reference<uno::XInterface
 
     // only get the function information from Introspection
 
-    uno::Reference<lang::XMultiServiceFactory> xManager = comphelper::getProcessServiceFactory();
-    if ( xManager.is() )
+    uno::Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext();
+
+    uno::Reference<beans::XIntrospection> xIntro = beans::Introspection::create(xContext);
+    uno::Any aObject;
+    aObject <<= xInterface;
+    uno::Reference<beans::XIntrospectionAccess> xAcc = xIntro->inspect(aObject);
+    if (xAcc.is())
     {
-        uno::Reference<beans::XIntrospection> xIntro(
-                                xManager->createInstance(rtl::OUString("com.sun.star.beans.Introspection")),
-                                uno::UNO_QUERY );
-        if ( xIntro.is() )
+        uno::Sequence< uno::Reference<reflection::XIdlMethod> > aMethods =
+                xAcc->getMethods( beans::MethodConcept::ALL );
+        long nMethodCount = aMethods.getLength();
+        const uno::Reference<reflection::XIdlMethod>* pArray = aMethods.getConstArray();
+        for (long nFuncPos=0; nFuncPos<nMethodCount; nFuncPos++)
         {
-            uno::Any aObject;
-            aObject <<= xInterface;
-            uno::Reference<beans::XIntrospectionAccess> xAcc = xIntro->inspect(aObject);
-            if (xAcc.is())
+            uno::Reference<reflection::XIdlMethod> xFunc = pArray[nFuncPos];
+            if (xFunc.is())
             {
-                uno::Sequence< uno::Reference<reflection::XIdlMethod> > aMethods =
-                        xAcc->getMethods( beans::MethodConcept::ALL );
-                long nMethodCount = aMethods.getLength();
-                const uno::Reference<reflection::XIdlMethod>* pArray = aMethods.getConstArray();
-                for (long nFuncPos=0; nFuncPos<nMethodCount; nFuncPos++)
+                rtl::OUString aFuncU = xFunc->getName();
+
+                // stored function name: (service name).(function)
+                rtl::OUStringBuffer aFuncNameBuffer( rServiceName.getLength()+1+aFuncU.getLength());
+                aFuncNameBuffer.append(rServiceName);
+                aFuncNameBuffer.append('.');
+                aFuncNameBuffer.append(aFuncU);
+                rtl::OUString aFuncName = aFuncNameBuffer.makeStringAndClear();
+
+                // internal names are skipped because no FuncData exists
+                ScUnoAddInFuncData* pOldData = const_cast<ScUnoAddInFuncData*>( GetFuncData( aFuncName ) );
+                if ( pOldData )
                 {
-                    uno::Reference<reflection::XIdlMethod> xFunc = pArray[nFuncPos];
-                    if (xFunc.is())
+                    // Create new (complete) argument info.
+                    // As in ReadFromAddIn, the reflection information is authoritative.
+                    // Local names and descriptions from pOldData are looked up using the
+                    // internal argument name.
+
+                    sal_Bool bValid = sal_True;
+                    long nVisibleCount = 0;
+                    long nCallerPos = SC_CALLERPOS_NONE;
+
+                    uno::Sequence<reflection::ParamInfo> aParams =
+                            xFunc->getParameterInfos();
+                    long nParamCount = aParams.getLength();
+                    const reflection::ParamInfo* pParArr = aParams.getConstArray();
+                    long nParamPos;
+                    for (nParamPos=0; nParamPos<nParamCount; nParamPos++)
                     {
-                        rtl::OUString aFuncU = xFunc->getName();
-
-                        // stored function name: (service name).(function)
-                        rtl::OUStringBuffer aFuncNameBuffer( rServiceName.getLength()+1+aFuncU.getLength());
-                        aFuncNameBuffer.append(rServiceName);
-                        aFuncNameBuffer.append('.');
-                        aFuncNameBuffer.append(aFuncU);
-                        rtl::OUString aFuncName = aFuncNameBuffer.makeStringAndClear();
-
-                        // internal names are skipped because no FuncData exists
-                        ScUnoAddInFuncData* pOldData = const_cast<ScUnoAddInFuncData*>( GetFuncData( aFuncName ) );
-                        if ( pOldData )
+                        if ( pParArr[nParamPos].aMode != reflection::ParamMode_IN )
+                            bValid = false;
+                        uno::Reference<reflection::XIdlClass> xParClass =
+                                    pParArr[nParamPos].aType;
+                        ScAddInArgumentType eArgType = lcl_GetArgType( xParClass );
+                        if ( eArgType == SC_ADDINARG_NONE )
+                            bValid = false;
+                        else if ( eArgType == SC_ADDINARG_CALLER )
+                            nCallerPos = nParamPos;
+                        else
+                            ++nVisibleCount;
+                    }
+                    if (bValid)
+                    {
+                        ScAddInArgDesc* pVisibleArgs = NULL;
+                        if ( nVisibleCount > 0 )
                         {
-                            // Create new (complete) argument info.
-                            // As in ReadFromAddIn, the reflection information is authoritative.
-                            // Local names and descriptions from pOldData are looked up using the
-                            // internal argument name.
-
-                            sal_Bool bValid = sal_True;
-                            long nVisibleCount = 0;
-                            long nCallerPos = SC_CALLERPOS_NONE;
-
-                            uno::Sequence<reflection::ParamInfo> aParams =
-                                    xFunc->getParameterInfos();
-                            long nParamCount = aParams.getLength();
-                            const reflection::ParamInfo* pParArr = aParams.getConstArray();
-                            long nParamPos;
+                            ScAddInArgDesc aDesc;
+                            pVisibleArgs = new ScAddInArgDesc[nVisibleCount];
+                            long nDestPos = 0;
                             for (nParamPos=0; nParamPos<nParamCount; nParamPos++)
                             {
-                                if ( pParArr[nParamPos].aMode != reflection::ParamMode_IN )
-                                    bValid = false;
                                 uno::Reference<reflection::XIdlClass> xParClass =
-                                            pParArr[nParamPos].aType;
+                                    pParArr[nParamPos].aType;
                                 ScAddInArgumentType eArgType = lcl_GetArgType( xParClass );
-                                if ( eArgType == SC_ADDINARG_NONE )
-                                    bValid = false;
-                                else if ( eArgType == SC_ADDINARG_CALLER )
-                                    nCallerPos = nParamPos;
-                                else
-                                    ++nVisibleCount;
-                            }
-                            if (bValid)
-                            {
-                                ScAddInArgDesc* pVisibleArgs = NULL;
-                                if ( nVisibleCount > 0 )
+                                if ( eArgType != SC_ADDINARG_CALLER )
                                 {
-                                    ScAddInArgDesc aDesc;
-                                    pVisibleArgs = new ScAddInArgDesc[nVisibleCount];
-                                    long nDestPos = 0;
-                                    for (nParamPos=0; nParamPos<nParamCount; nParamPos++)
+                                    const ScAddInArgDesc* pOldArgDesc =
+                                        lcl_FindArgDesc( *pOldData, pParArr[nParamPos].aName );
+                                    if ( pOldArgDesc )
                                     {
-                                        uno::Reference<reflection::XIdlClass> xParClass =
-                                            pParArr[nParamPos].aType;
-                                        ScAddInArgumentType eArgType = lcl_GetArgType( xParClass );
-                                        if ( eArgType != SC_ADDINARG_CALLER )
-                                        {
-                                            const ScAddInArgDesc* pOldArgDesc =
-                                                lcl_FindArgDesc( *pOldData, pParArr[nParamPos].aName );
-                                            if ( pOldArgDesc )
-                                            {
-                                                aDesc.aName = pOldArgDesc->aName;
-                                                aDesc.aDescription = pOldArgDesc->aDescription;
-                                            }
-                                            else
-                                                aDesc.aName = aDesc.aDescription = "###";
+                                        aDesc.aName = pOldArgDesc->aName;
+                                        aDesc.aDescription = pOldArgDesc->aDescription;
+                                    }
+                                    else
+                                        aDesc.aName = aDesc.aDescription = "###";
 
-                                            sal_Bool bOptional =
-                                                ( eArgType == SC_ADDINARG_VALUE_OR_ARRAY ||
-                                                  eArgType == SC_ADDINARG_VARARGS );
+                                    sal_Bool bOptional =
+                                        ( eArgType == SC_ADDINARG_VALUE_OR_ARRAY ||
+                                          eArgType == SC_ADDINARG_VARARGS );
 
-                                            aDesc.eType = eArgType;
-                                            aDesc.bOptional = bOptional;
-                                            //! initialize aInternalName only from config?
-                                            aDesc.aInternalName = pParArr[nParamPos].aName;
+                                    aDesc.eType = eArgType;
+                                    aDesc.bOptional = bOptional;
+                                    //! initialize aInternalName only from config?
+                                    aDesc.aInternalName = pParArr[nParamPos].aName;
 
-                                            pVisibleArgs[nDestPos++] = aDesc;
-                                        }
-                                    }
-                                    OSL_ENSURE( nDestPos==nVisibleCount, "wrong count" );
+                                    pVisibleArgs[nDestPos++] = aDesc;
                                 }
+                            }
+                            OSL_ENSURE( nDestPos==nVisibleCount, "wrong count" );
+                        }
 
-                                pOldData->SetFunction( xFunc, aObject );
-                                pOldData->SetArguments( nVisibleCount, pVisibleArgs );
-                                pOldData->SetCallerPos( nCallerPos );
+                        pOldData->SetFunction( xFunc, aObject );
+                        pOldData->SetArguments( nVisibleCount, pVisibleArgs );
+                        pOldData->SetCallerPos( nCallerPos );
 
-                                if ( pFunctionList )
-                                    lcl_UpdateFunctionList( *pFunctionList, *pOldData );
+                        if ( pFunctionList )
+                            lcl_UpdateFunctionList( *pFunctionList, *pOldData );
 
-                                delete[] pVisibleArgs;
-                            }
-                        }
+                        delete[] pVisibleArgs;
                     }
                 }
             }
diff --git a/sc/source/ui/vba/vbahelper.cxx b/sc/source/ui/vba/vbahelper.cxx
index ce5e680..947e6a8 100644
--- a/sc/source/ui/vba/vbahelper.cxx
+++ b/sc/source/ui/vba/vbahelper.cxx
@@ -36,7 +36,7 @@
 #include <com/sun/star/uno/XComponentContext.hpp>
 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XIntrospection.hpp>
+#include <com/sun/star/beans/Introspection.hpp>
 
 #include <comphelper/processfactory.hxx>
 
@@ -82,8 +82,8 @@ getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException)
     static uno::Reference< beans::XIntrospection > xIntrospection;
     if( !xIntrospection.is() )
     {
-        uno::Reference< lang::XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
-        xIntrospection.set( xFactory->createInstance( rtl::OUString( "com.sun.star.beans.Introspection" ) ), uno::UNO_QUERY_THROW );
+        uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+        xIntrospection.set( beans::Introspection::create(xContext) );
     }
     return xIntrospection->inspect( aObject );
 }
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index e1703f4..964c595 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -29,7 +29,7 @@
 #include <com/sun/star/script/XLibraryContainer.hpp>
 #include <cppuhelper/implementationentry.hxx>
 #include <cppuhelper/exc_hlp.hxx>
-#include <com/sun/star/beans/XIntrospection.hpp>
+#include <com/sun/star/beans/Introspection.hpp>
 #include <com/sun/star/resource/XStringResourceSupplier.hpp>
 #include <com/sun/star/resource/XStringResourceManager.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
@@ -578,34 +578,20 @@ static ::rtl::OUString aResourceResolverPropName("ResourceResolver");
 
         if( !xIntrospection.is() )
         {
-            Reference< XMultiComponentFactory > xSMgr( m_xContext->getServiceManager(), UNO_QUERY );
-            if ( !xSMgr.is() )
-            {
-                throw RuntimeException(
-                    ::rtl::OUString( "DialogProviderImpl::getIntrospectionAccess: Couldn't instantiate MultiComponent factory"  ),
-                        Reference< XInterface >() );
-            }
-
             // Get introspection service
-            Reference< XInterface > xI = xSMgr->createInstanceWithContext
-                ( rtl::OUString("com.sun.star.beans.Introspection"), m_xContext );
-            if (xI.is())
-                xIntrospection = Reference< XIntrospection >::query( xI );
+            xIntrospection = Introspection::create( m_xContext );
         }
 
-        if( xIntrospection.is() )
+        // Do introspection
+        try
         {
-            // Do introspection
-            try
-            {
-                Any aHandlerAny;
-                aHandlerAny <<= rxHandler;
-                xIntrospectionAccess = xIntrospection->inspect( aHandlerAny );
-            }
-            catch( RuntimeException& )
-            {
-                xIntrospectionAccess.clear();
-            }
+            Any aHandlerAny;
+            aHandlerAny <<= rxHandler;
+            xIntrospectionAccess = xIntrospection->inspect( aHandlerAny );
+        }
+        catch( RuntimeException& )
+        {
+            xIntrospectionAccess.clear();
         }
         return xIntrospectionAccess;
     }
diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx
index ef33f8c..ee1768a 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 );
         }
     }
 
diff --git a/stoc/source/invocation/invocation.cxx b/stoc/source/invocation/invocation.cxx
index 8b7ea70..5445173 100644
--- a/stoc/source/invocation/invocation.cxx
+++ b/stoc/source/invocation/invocation.cxx
@@ -36,7 +36,7 @@
 #include <com/sun/star/container/XEnumerationAccess.hpp>
 #include <com/sun/star/beans/XExactName.hpp>
 #include <com/sun/star/beans/XMaterialHolder.hpp>
-#include <com/sun/star/beans/XIntrospection.hpp>
+#include <com/sun/star/beans/Introspection.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/beans/MethodConcept.hpp>
@@ -1106,11 +1106,7 @@ InvocationService::InvocationService( const Reference<XComponentContext> & xCtx
             OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.script.Converter")),
             xCtx ),
         UNO_QUERY );
-    xIntrospection = Reference<XIntrospection>(
-        mxSMgr->createInstanceWithContext(
-            OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.beans.Introspection")),
-            xCtx),
-        UNO_QUERY);
+    xIntrospection = Introspection::create(xCtx);
     mxCtx->getValueByName(
         OUString(
             RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.reflection.theCoreReflection")) )
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index f9506a3..813d436 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -59,6 +59,7 @@
 #include <com/sun/star/awt/XCheckBox.hpp>
 #include <com/sun/star/awt/XListBox.hpp>
 #include <com/sun/star/awt/XTextComponent.hpp>
+#include <com/sun/star/beans/Introspection.hpp>
 #include <com/sun/star/beans/NamedValue.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/beans/XPropertyState.hpp>
@@ -84,7 +85,6 @@
 #include <com/sun/star/util/XModifyBroadcaster.hpp>
 #include <com/sun/star/util/XNumberFormatter.hpp>
 #include <com/sun/star/view/XSelectionSupplier.hpp>
-#include <com/sun/star/beans/XIntrospection.hpp>
 
 #include <comphelper/extract.hxx>
 #include <comphelper/evtmethodhelper.hxx>
@@ -385,16 +385,16 @@ namespace
         Sequence< Type> aModelListeners;
         Sequence< Type> aControlListeners;
 
-        Reference< XIntrospection> xModelIntrospection(::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString("com.sun.star.beans.Introspection")), UNO_QUERY);
-        Reference< XIntrospection> xControlIntrospection(::comphelper::getProcessServiceFactory()->createInstance(::rtl::OUString("com.sun.star.beans.Introspection")), UNO_QUERY);
+        Reference< XIntrospection> xModelIntrospection = Introspection::create(::comphelper::getProcessComponentContext());
+        Reference< XIntrospection> xControlIntrospection = Introspection::create(::comphelper::getProcessComponentContext());
 
-        if (xModelIntrospection.is() && xModel.is())
+        if (xModel.is())
         {
             Any aModel(makeAny(xModel));
             aModelListeners = xModelIntrospection->inspect(aModel)->getSupportedListeners();
         }
 
-        if (xControlIntrospection.is() && xControl.is())
+        if (xControl.is())
         {
             Any aControl(makeAny(xControl));
             aControlListeners = xControlIntrospection->inspect(aControl)->getSupportedListeners();
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index dece6b5..a531e06 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -31,7 +31,7 @@
 #include <com/sun/star/uno/XComponentContext.hpp>
 #include <com/sun/star/lang/XUnoTunnel.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/util/MeasureUnit.hpp>
 #include <com/sun/star/awt/XWindow.hpp>
 #include <com/sun/star/awt/XDialog.hpp>
@@ -109,8 +109,8 @@ getIntrospectionAccess( const uno::Any& aObject ) throw (uno::RuntimeException)
     static uno::Reference< beans::XIntrospection > xIntrospection;
     if( !xIntrospection.is() )
     {
-        uno::Reference< lang::XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
-        xIntrospection.set( xFactory->createInstance( "com.sun.star.beans.Introspection" ), uno::UNO_QUERY_THROW );
+        uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+        xIntrospection.set( beans::Introspection::create( xContext ) );
     }
     return xIntrospection->inspect( aObject );
 }


More information about the Libreoffice-commits mailing list