From 23b04dae8b5ff6dbc4c4b63bfe08079ac6ed74ef Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 12 Sep 2011 15:13:28 +0200 Subject: sb140: #i117698# no implementations of XIdlClassProvider remain, so code that checks for it can be removed --- stoc/inc/pch/precompiled_stoc.hxx | 1 - stoc/source/corereflection/corefl.xml | 1 - stoc/source/inspect/insp.xml | 1 - stoc/source/inspect/introspection.cxx | 1053 ++++++++++++++++----------------- stoc/source/invocation/inv.xml | 1 - 5 files changed, 513 insertions(+), 544 deletions(-) (limited to 'stoc') diff --git a/stoc/inc/pch/precompiled_stoc.hxx b/stoc/inc/pch/precompiled_stoc.hxx index 3e0b4d6dee3f..29d7fe6dec95 100644 --- a/stoc/inc/pch/precompiled_stoc.hxx +++ b/stoc/inc/pch/precompiled_stoc.hxx @@ -125,7 +125,6 @@ #include "com/sun/star/reflection/XEnumTypeDescription.hpp" #include "com/sun/star/reflection/XIdlArray.hpp" #include "com/sun/star/reflection/XIdlClass.hpp" -#include "com/sun/star/reflection/XIdlClassProvider.hpp" #include "com/sun/star/reflection/XIdlField.hpp" #include "com/sun/star/reflection/XIdlField2.hpp" #include "com/sun/star/reflection/XIdlMember.hpp" diff --git a/stoc/source/corereflection/corefl.xml b/stoc/source/corereflection/corefl.xml index 5dba80b6abff..521ba43737f5 100644 --- a/stoc/source/corereflection/corefl.xml +++ b/stoc/source/corereflection/corefl.xml @@ -6,7 +6,6 @@ Daniel Boelzle com.sun.star.comp.stoc.CoreReflection -This service is the implementation of XIdlClassProvider. The service provides reflection and access to all uno types (interfaces, structs, enums, ...). diff --git a/stoc/source/inspect/insp.xml b/stoc/source/inspect/insp.xml index 48b46d273cb1..7170f0f20692 100644 --- a/stoc/source/inspect/insp.xml +++ b/stoc/source/inspect/insp.xml @@ -44,7 +44,6 @@ com.sun.star.container.XNameContainer com.sun.star.container.XIndexContainer com.sun.star.reflection.XIdlReflection - com.sun.star.reflection.XIdlClassProvider com.sun.star.reflection.XIdlClass com.sun.star.reflection.XIdlField2 com.sun.star.reflection.XIdlArray diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index 50be56632735..253b0f418680 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -53,7 +53,6 @@ #include #include #include -#include #include #include #include @@ -2054,16 +2053,14 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns // Pruefen: Ist schon ein passendes Access-Objekt gecached? Sequence< Reference > SupportedClassSeq; Sequence< Type > SupportedTypesSeq; - Reference xClassProvider; Reference xTypeProvider; Reference xImplClass; Reference xPropSetInfo; Reference xPropSet; - // Bei Interfaces XTypeProvider / XIdlClassProvider- und PropertySet-Interface anfordern + // Bei Interfaces XTypeProvider- und PropertySet-Interface anfordern if( eType == TypeClass_INTERFACE ) { - // XIdlClassProvider xTypeProvider = Reference::query( x ); if( xTypeProvider.is() ) { @@ -2083,19 +2080,6 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns } } else - { - // XIdlClassProvider - xClassProvider = Reference::query( x ); - if( xClassProvider.is() ) - { - SupportedClassSeq = xClassProvider->getIdlClasses(); - if( SupportedClassSeq.getLength() ) - xImplClass = SupportedClassSeq.getConstArray()[0]; - } - } - // #70197, fuer InvocationAdapter: Interface-Typ im Any auch ohne - // ClassProvider unterstuetzen - if( !xClassProvider.is() && !xTypeProvider.is() ) { xImplClass = TypeToIdlClass( aToInspectObj.getValueType(), m_xSMgr ); SupportedClassSeq.realloc( 1 ); @@ -2314,655 +2298,644 @@ IntrospectionAccessStatic_Impl* ImplIntrospection::implInspect(const Any& aToIns } } + // Indizes in die Export-Tabellen + sal_Int32 iAllExportedMethod = 0; + sal_Int32 iAllSupportedListener = 0; - // Jetzt alle weiteren implementierten Interfaces durchgehen - // Diese muessen durch das XIdlClassProvider-Interface geliefert werden. - // #70197, fuer InvocationAdapter: Interface-Typ im Any auch ohne - // ClassProvider unterstuetzen - //if( xClassProvider.is() ) - { - // Indizes in die Export-Tabellen - sal_Int32 iAllExportedMethod = 0; - sal_Int32 iAllSupportedListener = 0; - - // Hashtable fuer Pruefung auf mehrfache Beruecksichtigung von Interfaces - CheckedInterfacesMap aCheckedInterfacesMap; + // Hashtable fuer Pruefung auf mehrfache Beruecksichtigung von Interfaces + CheckedInterfacesMap aCheckedInterfacesMap; - // Flag, ob XInterface-Methoden erfasst werden sollen - // (das darf nur einmal erfolgen, initial zulassen) - sal_Bool bXInterfaceIsInvalid = sal_False; + // Flag, ob XInterface-Methoden erfasst werden sollen + // (das darf nur einmal erfolgen, initial zulassen) + sal_Bool bXInterfaceIsInvalid = sal_False; - // Flag, ob die XInterface-Methoden schon erfasst wurden. Wenn sal_True, - // wird bXInterfaceIsInvalid am Ende der Iface-Schleife aktiviert und - // XInterface-Methoden werden danach abgeklemmt. - sal_Bool bFoundXInterface = sal_False; + // Flag, ob die XInterface-Methoden schon erfasst wurden. Wenn sal_True, + // wird bXInterfaceIsInvalid am Ende der Iface-Schleife aktiviert und + // XInterface-Methoden werden danach abgeklemmt. + sal_Bool bFoundXInterface = sal_False; - // Schleife ueber alle vom ClassProvider angegebenen Klassen - sal_Int32 nClassCount = SupportedClassSeq.getLength(); - for( sal_Int32 nIdx = 0 ; nIdx < nClassCount; nIdx++ ) + sal_Int32 nClassCount = SupportedClassSeq.getLength(); + for( sal_Int32 nIdx = 0 ; nIdx < nClassCount; nIdx++ ) + { + Reference xImplClass2 = SupportedClassSeq.getConstArray()[nIdx]; + while( xImplClass2.is() ) { - Reference xImplClass2 = SupportedClassSeq.getConstArray()[nIdx]; - while( xImplClass2.is() ) - { - // Interfaces der Implementation holen - Sequence< Reference > aClassSeq = xImplClass2->getInterfaces(); - sal_Int32 nIfaceCount = aClassSeq.getLength(); + // Interfaces der Implementation holen + Sequence< Reference > aClassSeq = xImplClass2->getInterfaces(); + sal_Int32 nIfaceCount = aClassSeq.getLength(); - aClassSeq.realloc( nIfaceCount + 1 ); - aClassSeq.getArray()[ nIfaceCount ] = xImplClass2; - nIfaceCount++; + aClassSeq.realloc( nIfaceCount + 1 ); + aClassSeq.getArray()[ nIfaceCount ] = xImplClass2; + nIfaceCount++; - const Reference* pParamArray = aClassSeq.getConstArray(); + const Reference* pParamArray = aClassSeq.getConstArray(); - for( sal_Int32 j = 0 ; j < nIfaceCount ; j++ ) - { - const Reference& rxIfaceClass = pParamArray[j]; + for( sal_Int32 j = 0 ; j < nIfaceCount ; j++ ) + { + const Reference& rxIfaceClass = pParamArray[j]; - // Pruefen, ob das Interface schon beruecksichtigt wurde. - XInterface* pIface = SAL_STATIC_CAST( XInterface*, rxIfaceClass.get() ); - if( aCheckedInterfacesMap.count( pIface ) > 0 ) - { - // Kennen wir schon - continue; - } - else - { - // Sonst eintragen - aCheckedInterfacesMap[ pIface ] = pIface; - } + // Pruefen, ob das Interface schon beruecksichtigt wurde. + XInterface* pIface = SAL_STATIC_CAST( XInterface*, rxIfaceClass.get() ); + if( aCheckedInterfacesMap.count( pIface ) > 0 ) + { + // Kennen wir schon + continue; + } + else + { + // Sonst eintragen + aCheckedInterfacesMap[ pIface ] = pIface; + } - //******************************************************************** + //******************************************************************** - // 2. Fields als Properties registrieren + // 2. Fields als Properties registrieren - // Felder holen - Sequence< Reference > fields = rxIfaceClass->getFields(); - const Reference* pFields = fields.getConstArray(); - sal_Int32 nLen = fields.getLength(); + // Felder holen + Sequence< Reference > fields = rxIfaceClass->getFields(); + const Reference* pFields = fields.getConstArray(); + sal_Int32 nLen = fields.getLength(); - for( i = 0 ; i < nLen ; i++ ) + for( i = 0 ; i < nLen ; i++ ) + { + Reference xField = pFields[i]; + Reference xPropType = xField->getType(); + + // Ist die PropertySequence gross genug? + pAccess->checkPropertyArraysSize + ( pAllPropArray, pMapTypeArray, pPropertyConceptArray, rPropCount ); + + // In eigenes Property-Array eintragen + Property& rProp = pAllPropArray[ rPropCount ]; + OUString aFieldName = xField->getName(); + rProp.Name = aFieldName; + rProp.Handle = rPropCount; + Type aFieldType( xPropType->getTypeClass(), xPropType->getName() ); + rProp.Type = aFieldType; + FieldAccessMode eAccessMode = xField->getAccessMode(); + rProp.Attributes = (eAccessMode == FieldAccessMode_READONLY || + eAccessMode == FieldAccessMode_CONST) + ? READONLY : 0; + + // Namen in Hashtable eintragen + OUString aPropName = rProp.Name; + + // Haben wir den Namen schon? + IntrospectionNameMap::iterator aIt = rPropNameMap.find( aPropName ); + if( !( aIt == rPropNameMap.end() ) ) { - Reference xField = pFields[i]; - Reference xPropType = xField->getType(); - - // Ist die PropertySequence gross genug? - pAccess->checkPropertyArraysSize - ( pAllPropArray, pMapTypeArray, pPropertyConceptArray, rPropCount ); - - // In eigenes Property-Array eintragen - Property& rProp = pAllPropArray[ rPropCount ]; - OUString aFieldName = xField->getName(); - rProp.Name = aFieldName; - rProp.Handle = rPropCount; - Type aFieldType( xPropType->getTypeClass(), xPropType->getName() ); - rProp.Type = aFieldType; - FieldAccessMode eAccessMode = xField->getAccessMode(); - rProp.Attributes = (eAccessMode == FieldAccessMode_READONLY || - eAccessMode == FieldAccessMode_CONST) - ? READONLY : 0; + /* TODO + OSL_TRACE( + String( "Introspection: Property \"" ) + + OOUStringToString( aPropName, CHARSET_SYSTEM ) + + String( "\" found more than once" ) ); + */ + continue; + } - // Namen in Hashtable eintragen - OUString aPropName = rProp.Name; + // Neuer Eintrag in die Hashtable + rPropNameMap[ aPropName ] = rPropCount; - // Haben wir den Namen schon? - IntrospectionNameMap::iterator aIt = rPropNameMap.find( aPropName ); - if( !( aIt == rPropNameMap.end() ) ) - { - /* TODO - OSL_TRACE( - String( "Introspection: Property \"" ) + - OOUStringToString( aPropName, CHARSET_SYSTEM ) + - String( "\" found more than once" ) ); - */ - continue; - } + // Tabelle fuer XExactName pflegen + rLowerToExactNameMap[ toLower( aPropName ) ] = aPropName; - // Neuer Eintrag in die Hashtable - rPropNameMap[ aPropName ] = rPropCount; + // Field merken + pAccess->checkInterfaceArraySize( pAccess->aInterfaceSeq1, + pInterfaces1, rPropCount ); + pInterfaces1[ rPropCount ] = xField; - // Tabelle fuer XExactName pflegen - rLowerToExactNameMap[ toLower( aPropName ) ] = aPropName; + // Art der Property merken + pMapTypeArray[ rPropCount ] = MAP_FIELD; + pPropertyConceptArray[ rPropCount ] = ATTRIBUTES; + pAccess->mnAttributePropCount++; - // Field merken - pAccess->checkInterfaceArraySize( pAccess->aInterfaceSeq1, - pInterfaces1, rPropCount ); - pInterfaces1[ rPropCount ] = xField; + // Count pflegen + rPropCount++; + } - // Art der Property merken - pMapTypeArray[ rPropCount ] = MAP_FIELD; - pPropertyConceptArray[ rPropCount ] = ATTRIBUTES; - pAccess->mnAttributePropCount++; + //******************************************************************** - // Count pflegen - rPropCount++; - } + // 3. Methoden - //******************************************************************** + // Zaehler fuer die gefundenen Listener + sal_Int32 nListenerCount = 0; - // 3. Methoden + // Alle Methoden holen und merken + Sequence< Reference > methods = rxIfaceClass->getMethods(); + const Reference* pSourceMethods = methods.getConstArray(); + sal_Int32 nSourceMethodCount = methods.getLength(); - // Zaehler fuer die gefundenen Listener - sal_Int32 nListenerCount = 0; + // 3. a) get/set- und Listener-Methoden suchen - // Alle Methoden holen und merken - Sequence< Reference > methods = rxIfaceClass->getMethods(); - const Reference* pSourceMethods = methods.getConstArray(); - sal_Int32 nSourceMethodCount = methods.getLength(); + // Feld fuer Infos ueber die Methoden anlegen, damit spaeter leicht die Methoden + // gefunden werden koennen, die nicht im Zusammenhang mit Properties oder Listenern + // stehen. NEU: auch MethodConceptArray initialisieren + MethodType* pMethodTypes = new MethodType[ nSourceMethodCount ]; + sal_Int32* pLocalMethodConcepts = new sal_Int32[ nSourceMethodCount ]; + for( i = 0 ; i < nSourceMethodCount ; i++ ) + { + pMethodTypes[ i ] = STANDARD_METHOD; + pLocalMethodConcepts[ i ] = 0; + } - // 3. a) get/set- und Listener-Methoden suchen + OUString aMethName; + OUString aPropName; + OUString aStartStr; + for( i = 0 ; i < nSourceMethodCount ; i++ ) + { + // Methode ansprechen + const Reference& rxMethod_i = pSourceMethods[i]; + sal_Int32& rMethodConcept_i = pLocalMethodConcepts[ i ]; - // Feld fuer Infos ueber die Methoden anlegen, damit spaeter leicht die Methoden - // gefunden werden koennen, die nicht im Zusammenhang mit Properties oder Listenern - // stehen. NEU: auch MethodConceptArray initialisieren - MethodType* pMethodTypes = new MethodType[ nSourceMethodCount ]; - sal_Int32* pLocalMethodConcepts = new sal_Int32[ nSourceMethodCount ]; - for( i = 0 ; i < nSourceMethodCount ; i++ ) - { - pMethodTypes[ i ] = STANDARD_METHOD; - pLocalMethodConcepts[ i ] = 0; - } + // Namen besorgen + aMethName = rxMethod_i->getName(); - OUString aMethName; - OUString aPropName; - OUString aStartStr; - for( i = 0 ; i < nSourceMethodCount ; i++ ) + // Methoden katalogisieren + // Alle (?) Methoden von XInterface filtern, damit z.B. nicht + // vom Scripting aus aquire oder release gerufen werden kann + if( rxMethod_i->getDeclaringClass()->equals( mxInterfaceClass ) ) { - // Methode ansprechen - const Reference& rxMethod_i = pSourceMethods[i]; - sal_Int32& rMethodConcept_i = pLocalMethodConcepts[ i ]; - - // Namen besorgen - aMethName = rxMethod_i->getName(); + // XInterface-Methoden sind hiermit einmal beruecksichtigt + bFoundXInterface = sal_True; - // Methoden katalogisieren - // Alle (?) Methoden von XInterface filtern, damit z.B. nicht - // vom Scripting aus aquire oder release gerufen werden kann - if( rxMethod_i->getDeclaringClass()->equals( mxInterfaceClass ) ) + if( bXInterfaceIsInvalid ) { - // XInterface-Methoden sind hiermit einmal beruecksichtigt - bFoundXInterface = sal_True; - - if( bXInterfaceIsInvalid ) - { - pMethodTypes[ i ] = INVALID_METHOD; - continue; - } - else - { - if( aMethName != OUString( RTL_CONSTASCII_USTRINGPARAM("queryInterface")) ) - { - rMethodConcept_i |= MethodConcept::DANGEROUS; - continue; - } - } + pMethodTypes[ i ] = INVALID_METHOD; + continue; } - else if( rxMethod_i->getDeclaringClass()->equals( mxAggregationClass ) ) + else { - if( aMethName == OUString( RTL_CONSTASCII_USTRINGPARAM("setDelegator")) ) + if( aMethName != OUString( RTL_CONSTASCII_USTRINGPARAM("queryInterface")) ) { rMethodConcept_i |= MethodConcept::DANGEROUS; continue; } } - else if( rxMethod_i->getDeclaringClass()->equals( mxElementAccessClass ) ) - { - rMethodConcept_i |= ( NAMECONTAINER | - INDEXCONTAINER | - ENUMERATION ); - } - else if( rxMethod_i->getDeclaringClass()->equals( mxNameContainerClass ) || - rxMethod_i->getDeclaringClass()->equals( mxNameAccessClass ) ) + } + else if( rxMethod_i->getDeclaringClass()->equals( mxAggregationClass ) ) + { + if( aMethName == OUString( RTL_CONSTASCII_USTRINGPARAM("setDelegator")) ) { - rMethodConcept_i |= NAMECONTAINER; + rMethodConcept_i |= MethodConcept::DANGEROUS; + continue; } - else if( rxMethod_i->getDeclaringClass()->equals( mxIndexContainerClass ) || - rxMethod_i->getDeclaringClass()->equals( mxIndexAccessClass ) ) + } + else if( rxMethod_i->getDeclaringClass()->equals( mxElementAccessClass ) ) + { + rMethodConcept_i |= ( NAMECONTAINER | + INDEXCONTAINER | + ENUMERATION ); + } + else if( rxMethod_i->getDeclaringClass()->equals( mxNameContainerClass ) || + rxMethod_i->getDeclaringClass()->equals( mxNameAccessClass ) ) + { + rMethodConcept_i |= NAMECONTAINER; + } + else if( rxMethod_i->getDeclaringClass()->equals( mxIndexContainerClass ) || + rxMethod_i->getDeclaringClass()->equals( mxIndexAccessClass ) ) + { + rMethodConcept_i |= INDEXCONTAINER; + } + else if( rxMethod_i->getDeclaringClass()->equals( mxEnumerationAccessClass ) ) + { + rMethodConcept_i |= ENUMERATION; + } + + // Wenn der Name zu kurz ist, wird's sowieso nichts + if( aMethName.getLength() <= 3 ) + continue; + + // Ist es eine get-Methode? + aStartStr = aMethName.copy( 0, 3 ); + if( aStartStr == OUString( RTL_CONSTASCII_USTRINGPARAM("get")) ) + { + // Namen der potentiellen Property + aPropName = aMethName.copy( 3 ); + + // get-Methode darf keinen Parameter haben + Sequence< Reference > getParams = rxMethod_i->getParameterTypes(); + if( getParams.getLength() > 0 ) { - rMethodConcept_i |= INDEXCONTAINER; + continue; } - else if( rxMethod_i->getDeclaringClass()->equals( mxEnumerationAccessClass ) ) + + // Haben wir den Namen schon? + IntrospectionNameMap::iterator aIt = rPropNameMap.find( aPropName ); + if( !( aIt == rPropNameMap.end() ) ) { - rMethodConcept_i |= ENUMERATION; + /* TODO + OSL_TRACE( + String( "Introspection: Property \"" ) + + OOUStringToString( aPropName, CHARSET_SYSTEM ) + + String( "\" found more than once" ) ); + */ + continue; } - // Wenn der Name zu kurz ist, wird's sowieso nichts - if( aMethName.getLength() <= 3 ) - continue; + // Eine readonly-Property ist es jetzt mindestens schon + rMethodConcept_i |= PROPERTY; + + pMethodTypes[i] = GETSET_METHOD; + Reference xGetRetType = rxMethod_i->getReturnType(); - // Ist es eine get-Methode? - aStartStr = aMethName.copy( 0, 3 ); - if( aStartStr == OUString( RTL_CONSTASCII_USTRINGPARAM("get")) ) + // Ist die PropertySequence gross genug? + pAccess->checkPropertyArraysSize + ( pAllPropArray, pMapTypeArray, pPropertyConceptArray, rPropCount ); + + // In eigenes Property-Array eintragen + Property& rProp = pAllPropArray[ rPropCount ]; + rProp.Name = aPropName; + rProp.Handle = rPropCount; + rProp.Type = Type( xGetRetType->getTypeClass(), xGetRetType->getName() ); + rProp.Attributes = READONLY; + + // Neuer Eintrag in die Hashtable + rPropNameMap[ aPropName ] = rPropCount; + + // Tabelle fuer XExactName pflegen + rLowerToExactNameMap[ toLower( aPropName ) ] = aPropName; + + // get-Methode merken + pAccess->checkInterfaceArraySize( pAccess->aInterfaceSeq1, + pInterfaces1, rPropCount ); + pInterfaces1[ rPropCount ] = rxMethod_i; + + // Art der Property merken + pMapTypeArray[ rPropCount ] = MAP_GETSET; + pPropertyConceptArray[ rPropCount ] = METHODS; + pAccess->mnMethodPropCount++; + + // Passende set-Methode suchen + sal_Int32 k; + for( k = 0 ; k < nSourceMethodCount ; k++ ) { - // Namen der potentiellen Property - aPropName = aMethName.copy( 3 ); + // Methode ansprechen + const Reference& rxMethod_k = pSourceMethods[k]; + + // Nur Methoden nehmen, die nicht schon zugeordnet sind + if( k == i || pMethodTypes[k] != STANDARD_METHOD ) + continue; + + // Name holen und auswerten + OUString aMethName2 = rxMethod_k->getName(); + OUString aStartStr2 = aMethName2.copy( 0, 3 ); + // ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!! + if( !( aStartStr2 == OUString( RTL_CONSTASCII_USTRINGPARAM("set")) ) ) + continue; - // get-Methode darf keinen Parameter haben - Sequence< Reference > getParams = rxMethod_i->getParameterTypes(); - if( getParams.getLength() > 0 ) + // Ist es denn der gleiche Name? + OUString aPropName2 = aMethName2.copy( 3 ); + // ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!! + if( !( aPropName == aPropName2 ) ) + continue; + + // set-Methode muss void returnen + Reference xSetRetType = rxMethod_k->getReturnType(); + if( xSetRetType->getTypeClass() != TypeClass_VOID ) { continue; } - // Haben wir den Namen schon? - IntrospectionNameMap::iterator aIt = rPropNameMap.find( aPropName ); - if( !( aIt == rPropNameMap.end() ) ) + // set-Methode darf nur einen Parameter haben + Sequence< Reference > setParams = rxMethod_k->getParameterTypes(); + sal_Int32 nParamCount = setParams.getLength(); + if( nParamCount != 1 ) { - /* TODO - OSL_TRACE( - String( "Introspection: Property \"" ) + - OOUStringToString( aPropName, CHARSET_SYSTEM ) + - String( "\" found more than once" ) ); - */ continue; } - // Eine readonly-Property ist es jetzt mindestens schon - rMethodConcept_i |= PROPERTY; + // Jetzt muss nur noch der return-Typ dem Parameter-Typ entsprechen + const Reference* pParamArray2 = setParams.getConstArray(); + Reference xParamType = pParamArray2[ 0 ]; + if( xParamType->equals( xGetRetType ) ) + { + pLocalMethodConcepts[ k ] = PROPERTY; - pMethodTypes[i] = GETSET_METHOD; - Reference xGetRetType = rxMethod_i->getReturnType(); + pMethodTypes[k] = GETSET_METHOD; - // Ist die PropertySequence gross genug? - pAccess->checkPropertyArraysSize - ( pAllPropArray, pMapTypeArray, pPropertyConceptArray, rPropCount ); + // ReadOnly-Flag wieder loschen + rProp.Attributes &= ~READONLY; - // In eigenes Property-Array eintragen - Property& rProp = pAllPropArray[ rPropCount ]; - rProp.Name = aPropName; - rProp.Handle = rPropCount; - rProp.Type = Type( xGetRetType->getTypeClass(), xGetRetType->getName() ); - rProp.Attributes = READONLY; + // set-Methode merken + pAccess->checkInterfaceArraySize( pAccess->aInterfaceSeq2, + pInterfaces2, rPropCount ); + pInterfaces2[ rPropCount ] = rxMethod_k; + } + } - // Neuer Eintrag in die Hashtable - rPropNameMap[ aPropName ] = rPropCount; + // Count pflegen + rPropCount++; + } - // Tabelle fuer XExactName pflegen - rLowerToExactNameMap[ toLower( aPropName ) ] = aPropName; + // Ist es eine addListener-Methode? + else if( aStartStr == OUString( RTL_CONSTASCII_USTRINGPARAM("add")) ) + { + OUString aListenerStr( RTL_CONSTASCII_USTRINGPARAM("Listener" ) ); - // get-Methode merken - pAccess->checkInterfaceArraySize( pAccess->aInterfaceSeq1, - pInterfaces1, rPropCount ); - pInterfaces1[ rPropCount ] = rxMethod_i; + // Namen der potentiellen Property + sal_Int32 nStrLen = aMethName.getLength(); + sal_Int32 nCopyLen = nStrLen - aListenerStr.getLength(); + OUString aEndStr = aMethName.copy( nCopyLen > 0 ? nCopyLen : 0 ); - // Art der Property merken - pMapTypeArray[ rPropCount ] = MAP_GETSET; - pPropertyConceptArray[ rPropCount ] = METHODS; - pAccess->mnMethodPropCount++; + // Endet das Teil auf Listener? + // ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!! + if( !( aEndStr == aListenerStr ) ) + continue; - // Passende set-Methode suchen - sal_Int32 k; - for( k = 0 ; k < nSourceMethodCount ; k++ ) - { - // Methode ansprechen - const Reference& rxMethod_k = pSourceMethods[k]; - - // Nur Methoden nehmen, die nicht schon zugeordnet sind - if( k == i || pMethodTypes[k] != STANDARD_METHOD ) - continue; - - // Name holen und auswerten - OUString aMethName2 = rxMethod_k->getName(); - OUString aStartStr2 = aMethName2.copy( 0, 3 ); - // ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!! - if( !( aStartStr2 == OUString( RTL_CONSTASCII_USTRINGPARAM("set")) ) ) - continue; - - // Ist es denn der gleiche Name? - OUString aPropName2 = aMethName2.copy( 3 ); - // ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!! - if( !( aPropName == aPropName2 ) ) - continue; - - // set-Methode muss void returnen - Reference xSetRetType = rxMethod_k->getReturnType(); - if( xSetRetType->getTypeClass() != TypeClass_VOID ) - { - continue; - } - - // set-Methode darf nur einen Parameter haben - Sequence< Reference > setParams = rxMethod_k->getParameterTypes(); - sal_Int32 nParamCount = setParams.getLength(); - if( nParamCount != 1 ) - { - continue; - } - - // Jetzt muss nur noch der return-Typ dem Parameter-Typ entsprechen - const Reference* pParamArray2 = setParams.getConstArray(); - Reference xParamType = pParamArray2[ 0 ]; - if( xParamType->equals( xGetRetType ) ) - { - pLocalMethodConcepts[ k ] = PROPERTY; - - pMethodTypes[k] = GETSET_METHOD; - - // ReadOnly-Flag wieder loschen - rProp.Attributes &= ~READONLY; - - // set-Methode merken - pAccess->checkInterfaceArraySize( pAccess->aInterfaceSeq2, - pInterfaces2, rPropCount ); - pInterfaces2[ rPropCount ] = rxMethod_k; - } - } + // Welcher Listener? + OUString aListenerName = aMethName.copy( 3, nStrLen - aListenerStr.getLength() - 3 ); + + // TODO: Hier koennten noch genauere Pruefungen vorgenommen werden + // - Rueckgabe-Typ + // - Anzahl und Art der Parameter - // Count pflegen - rPropCount++; - } - // Ist es eine addListener-Methode? - else if( aStartStr == OUString( RTL_CONSTASCII_USTRINGPARAM("add")) ) + // Passende remove-Methode suchen, sonst gilt's nicht + sal_Int32 k; + for( k = 0 ; k < nSourceMethodCount ; k++ ) { - OUString aListenerStr( RTL_CONSTASCII_USTRINGPARAM("Listener" ) ); + // Methode ansprechen + const Reference& rxMethod_k = pSourceMethods[k]; - // Namen der potentiellen Property - sal_Int32 nStrLen = aMethName.getLength(); - sal_Int32 nCopyLen = nStrLen - aListenerStr.getLength(); - OUString aEndStr = aMethName.copy( nCopyLen > 0 ? nCopyLen : 0 ); + // Nur Methoden nehmen, die nicht schon zugeordnet sind + if( k == i || pMethodTypes[k] != STANDARD_METHOD ) + continue; - // Endet das Teil auf Listener? + // Name holen und auswerten + OUString aMethName2 = rxMethod_k->getName(); + sal_Int32 nNameLen = aMethName2.getLength(); + sal_Int32 nCopyLen2 = (nNameLen < 6) ? nNameLen : 6; + OUString aStartStr2 = aMethName2.copy( 0, nCopyLen2 ); + OUString aRemoveStr( RTL_CONSTASCII_USTRINGPARAM("remove" ) ); // ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!! - if( !( aEndStr == aListenerStr ) ) + if( !( aStartStr2 == aRemoveStr ) ) continue; - // Welcher Listener? - OUString aListenerName = aMethName.copy( 3, nStrLen - aListenerStr.getLength() - 3 ); + // Ist es denn der gleiche Listener? + if( aMethName2.getLength() - aRemoveStr.getLength() <= aListenerStr.getLength() ) + continue; + OUString aListenerName2 = aMethName2.copy + ( 6, aMethName2.getLength() - aRemoveStr.getLength() - aListenerStr.getLength() ); + // ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!! + if( !( aListenerName == aListenerName2 ) ) + continue; // TODO: Hier koennten noch genauere Pruefungen vorgenommen werden // - Rueckgabe-Typ // - Anzahl und Art der Parameter - // Passende remove-Methode suchen, sonst gilt's nicht - sal_Int32 k; - for( k = 0 ; k < nSourceMethodCount ; k++ ) - { - // Methode ansprechen - const Reference& rxMethod_k = pSourceMethods[k]; - - // Nur Methoden nehmen, die nicht schon zugeordnet sind - if( k == i || pMethodTypes[k] != STANDARD_METHOD ) - continue; - - // Name holen und auswerten - OUString aMethName2 = rxMethod_k->getName(); - sal_Int32 nNameLen = aMethName2.getLength(); - sal_Int32 nCopyLen2 = (nNameLen < 6) ? nNameLen : 6; - OUString aStartStr2 = aMethName2.copy( 0, nCopyLen2 ); - OUString aRemoveStr( RTL_CONSTASCII_USTRINGPARAM("remove" ) ); - // ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!! - if( !( aStartStr2 == aRemoveStr ) ) - continue; - - // Ist es denn der gleiche Listener? - if( aMethName2.getLength() - aRemoveStr.getLength() <= aListenerStr.getLength() ) - continue; - OUString aListenerName2 = aMethName2.copy - ( 6, aMethName2.getLength() - aRemoveStr.getLength() - aListenerStr.getLength() ); - // ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!! - if( !( aListenerName == aListenerName2 ) ) - continue; - - // TODO: Hier koennten noch genauere Pruefungen vorgenommen werden - // - Rueckgabe-Typ - // - Anzahl und Art der Parameter - - - // Methoden sind als Listener-Schnittstelle erkannt - rMethodConcept_i |= LISTENER; - pLocalMethodConcepts[ k ] |= LISTENER; - - pMethodTypes[i] = ADD_LISTENER_METHOD; - pMethodTypes[k] = REMOVE_LISTENER_METHOD; - nListenerCount++; - } + // Methoden sind als Listener-Schnittstelle erkannt + rMethodConcept_i |= LISTENER; + pLocalMethodConcepts[ k ] |= LISTENER; + + pMethodTypes[i] = ADD_LISTENER_METHOD; + pMethodTypes[k] = REMOVE_LISTENER_METHOD; + nListenerCount++; } } + } - // Jetzt koennen noch SET-Methoden ohne zugehoerige GET-Methode existieren, - // diese muessen zu Write-Only-Properties gemachte werden. - for( i = 0 ; i < nSourceMethodCount ; i++ ) - { - // Methode ansprechen - const Reference& rxMethod_i = pSourceMethods[i]; + // Jetzt koennen noch SET-Methoden ohne zugehoerige GET-Methode existieren, + // diese muessen zu Write-Only-Properties gemachte werden. + for( i = 0 ; i < nSourceMethodCount ; i++ ) + { + // Methode ansprechen + const Reference& rxMethod_i = pSourceMethods[i]; - // Nur Methoden nehmen, die nicht schon zugeordnet sind - if( pMethodTypes[i] != STANDARD_METHOD ) - continue; + // Nur Methoden nehmen, die nicht schon zugeordnet sind + if( pMethodTypes[i] != STANDARD_METHOD ) + continue; - // Namen besorgen - aMethName = rxMethod_i->getName(); + // Namen besorgen + aMethName = rxMethod_i->getName(); - // Wenn der Name zu kurz ist, wird's sowieso nichts - if( aMethName.getLength() <= 3 ) - continue; + // Wenn der Name zu kurz ist, wird's sowieso nichts + if( aMethName.getLength() <= 3 ) + continue; - // Ist es eine set-Methode ohne zugehoerige get-Methode? - aStartStr = aMethName.copy( 0, 3 ); - if( aStartStr == OUString( RTL_CONSTASCII_USTRINGPARAM("set")) ) - { - // Namen der potentiellen Property - aPropName = aMethName.copy( 3 ); + // Ist es eine set-Methode ohne zugehoerige get-Methode? + aStartStr = aMethName.copy( 0, 3 ); + if( aStartStr == OUString( RTL_CONSTASCII_USTRINGPARAM("set")) ) + { + // Namen der potentiellen Property + aPropName = aMethName.copy( 3 ); - // set-Methode muss void returnen - Reference xSetRetType = rxMethod_i->getReturnType(); - if( xSetRetType->getTypeClass() != TypeClass_VOID ) - { - continue; - } + // set-Methode muss void returnen + Reference xSetRetType = rxMethod_i->getReturnType(); + if( xSetRetType->getTypeClass() != TypeClass_VOID ) + { + continue; + } - // set-Methode darf nur einen Parameter haben - Sequence< Reference > setParams = rxMethod_i->getParameterTypes(); - sal_Int32 nParamCount = setParams.getLength(); - if( nParamCount != 1 ) - { - continue; - } + // set-Methode darf nur einen Parameter haben + Sequence< Reference > setParams = rxMethod_i->getParameterTypes(); + sal_Int32 nParamCount = setParams.getLength(); + if( nParamCount != 1 ) + { + continue; + } - // Haben wir den Namen schon? - IntrospectionNameMap::iterator aIt = rPropNameMap.find( aPropName ); - if( !( aIt == rPropNameMap.end() ) ) - { - /* TODO: - OSL_TRACE( - String( "Introspection: Property \"" ) + - OOUStringToString( aPropName, CHARSET_SYSTEM ) + - String( "\" found more than once" ) ); - */ - continue; - } + // Haben wir den Namen schon? + IntrospectionNameMap::iterator aIt = rPropNameMap.find( aPropName ); + if( !( aIt == rPropNameMap.end() ) ) + { + /* TODO: + OSL_TRACE( + String( "Introspection: Property \"" ) + + OOUStringToString( aPropName, CHARSET_SYSTEM ) + + String( "\" found more than once" ) ); + */ + continue; + } - // Alles klar, es ist eine Write-Only-Property - pLocalMethodConcepts[ i ] = PROPERTY; + // Alles klar, es ist eine Write-Only-Property + pLocalMethodConcepts[ i ] = PROPERTY; - pMethodTypes[i] = GETSET_METHOD; - Reference xGetRetType = setParams.getConstArray()[0]; + pMethodTypes[i] = GETSET_METHOD; + Reference xGetRetType = setParams.getConstArray()[0]; - // Ist die PropertySequence gross genug? - pAccess->checkPropertyArraysSize - ( pAllPropArray, pMapTypeArray, pPropertyConceptArray, rPropCount ); + // Ist die PropertySequence gross genug? + pAccess->checkPropertyArraysSize + ( pAllPropArray, pMapTypeArray, pPropertyConceptArray, rPropCount ); - // In eigenes Property-Array eintragen - Property& rProp = pAllPropArray[ rPropCount ]; - rProp.Name = aPropName; - rProp.Handle = rPropCount; - rProp.Type = Type( xGetRetType->getTypeClass(), xGetRetType->getName() ); - rProp.Attributes = 0; // PROPERTY_WRITEONLY ??? + // In eigenes Property-Array eintragen + Property& rProp = pAllPropArray[ rPropCount ]; + rProp.Name = aPropName; + rProp.Handle = rPropCount; + rProp.Type = Type( xGetRetType->getTypeClass(), xGetRetType->getName() ); + rProp.Attributes = 0; // PROPERTY_WRITEONLY ??? - // Neuer Eintrag in die Hashtable - rPropNameMap[ aPropName ] = rPropCount; + // Neuer Eintrag in die Hashtable + rPropNameMap[ aPropName ] = rPropCount; - // Tabelle fuer XExactName pflegen - rLowerToExactNameMap[ toLower( aPropName ) ] = aPropName; + // Tabelle fuer XExactName pflegen + rLowerToExactNameMap[ toLower( aPropName ) ] = aPropName; - // set-Methode merken - pAccess->checkInterfaceArraySize( pAccess->aInterfaceSeq2, - pInterfaces2, rPropCount ); - pInterfaces2[ rPropCount ] = rxMethod_i; + // set-Methode merken + pAccess->checkInterfaceArraySize( pAccess->aInterfaceSeq2, + pInterfaces2, rPropCount ); + pInterfaces2[ rPropCount ] = rxMethod_i; - // Art der Property merken - pMapTypeArray[ rPropCount ] = MAP_SETONLY; - pPropertyConceptArray[ rPropCount ] = METHODS; - pAccess->mnMethodPropCount++; + // Art der Property merken + pMapTypeArray[ rPropCount ] = MAP_SETONLY; + pPropertyConceptArray[ rPropCount ] = METHODS; + pAccess->mnMethodPropCount++; - // Count pflegen - rPropCount++; - } + // Count pflegen + rPropCount++; } + } - //******************************************************************** + //******************************************************************** - // 4. Methoden in die Gesamt-Sequence uebernehmen + // 4. Methoden in die Gesamt-Sequence uebernehmen - // Wieviele Methoden muessen in die Method-Sequence? - sal_Int32 nExportedMethodCount = 0; - sal_Int32 nSupportedListenerCount = 0; - for( i = 0 ; i < nSourceMethodCount ; i++ ) + // Wieviele Methoden muessen in die Method-Sequence? + sal_Int32 nExportedMethodCount = 0; + sal_Int32 nSupportedListenerCount = 0; + for( i = 0 ; i < nSourceMethodCount ; i++ ) + { + if( pMethodTypes[ i ] != INVALID_METHOD ) { - if( pMethodTypes[ i ] != INVALID_METHOD ) - { - nExportedMethodCount++; - } - if( pMethodTypes[ i ] == ADD_LISTENER_METHOD ) - { - nSupportedListenerCount++; - } + nExportedMethodCount++; } + if( pMethodTypes[ i ] == ADD_LISTENER_METHOD ) + { + nSupportedListenerCount++; + } + } - // Sequences im Access-Objekt entsprechend aufbohren - pAccess->maAllMethodSeq.realloc( nExportedMethodCount + iAllExportedMethod ); - pAccess->maMethodConceptSeq.realloc( nExportedMethodCount + iAllExportedMethod ); - pAccess->maSupportedListenerSeq.realloc( nSupportedListenerCount + iAllSupportedListener ); + // Sequences im Access-Objekt entsprechend aufbohren + pAccess->maAllMethodSeq.realloc( nExportedMethodCount + iAllExportedMethod ); + pAccess->maMethodConceptSeq.realloc( nExportedMethodCount + iAllExportedMethod ); + pAccess->maSupportedListenerSeq.realloc( nSupportedListenerCount + iAllSupportedListener ); - // Methoden reinschreiben - Reference* pDestMethods = pAccess->maAllMethodSeq.getArray(); - sal_Int32* pMethodConceptArray = pAccess->maMethodConceptSeq.getArray(); - Type* pListenerClassRefs = pAccess->maSupportedListenerSeq.getArray(); - for( i = 0 ; i < nSourceMethodCount ; i++ ) + // Methoden reinschreiben + Reference* pDestMethods = pAccess->maAllMethodSeq.getArray(); + sal_Int32* pMethodConceptArray = pAccess->maMethodConceptSeq.getArray(); + Type* pListenerClassRefs = pAccess->maSupportedListenerSeq.getArray(); + for( i = 0 ; i < nSourceMethodCount ; i++ ) + { + if( pMethodTypes[ i ] != INVALID_METHOD ) { - if( pMethodTypes[ i ] != INVALID_METHOD ) - { - // Methode ansprechen - const Reference& rxMethod = pSourceMethods[i]; + // Methode ansprechen + const Reference& rxMethod = pSourceMethods[i]; - // Namen in Hashtable eintragen, wenn nicht schon bekannt - OUString aMethName2 = rxMethod->getName(); - IntrospectionNameMap::iterator aIt = rMethodNameMap.find( aMethName2 ); - if( aIt == rMethodNameMap.end() ) - { - // Eintragen - rMethodNameMap[ aMethName2 ] = iAllExportedMethod; + // Namen in Hashtable eintragen, wenn nicht schon bekannt + OUString aMethName2 = rxMethod->getName(); + IntrospectionNameMap::iterator aIt = rMethodNameMap.find( aMethName2 ); + if( aIt == rMethodNameMap.end() ) + { + // Eintragen + rMethodNameMap[ aMethName2 ] = iAllExportedMethod; - // Tabelle fuer XExactName pflegen - rLowerToExactNameMap[ toLower( aMethName2 ) ] = aMethName2; - } - else - { - sal_Int32 iHashResult = (*aIt).second; + // Tabelle fuer XExactName pflegen + rLowerToExactNameMap[ toLower( aMethName2 ) ] = aMethName2; + } + else + { + sal_Int32 iHashResult = (*aIt).second; - Reference xExistingMethod = pDestMethods[ iHashResult ]; + Reference xExistingMethod = pDestMethods[ iHashResult ]; - Reference< XIdlClass > xExistingMethClass = - xExistingMethod->getDeclaringClass(); - Reference< XIdlClass > xNewMethClass = rxMethod->getDeclaringClass(); - if( xExistingMethClass->equals( xNewMethClass ) ) - continue; - } + Reference< XIdlClass > xExistingMethClass = + xExistingMethod->getDeclaringClass(); + Reference< XIdlClass > xNewMethClass = rxMethod->getDeclaringClass(); + if( xExistingMethClass->equals( xNewMethClass ) ) + continue; + } - pDestMethods[ iAllExportedMethod ] = rxMethod; + pDestMethods[ iAllExportedMethod ] = rxMethod; - // Wenn kein Concept gesetzt wurde, ist die Methode "normal" - sal_Int32& rMethodConcept_i = pLocalMethodConcepts[ i ]; - if( !rMethodConcept_i ) - rMethodConcept_i = MethodConcept_NORMAL_IMPL; - pMethodConceptArray[ iAllExportedMethod ] = rMethodConcept_i; - iAllExportedMethod++; - } - if( pMethodTypes[ i ] == ADD_LISTENER_METHOD ) + // Wenn kein Concept gesetzt wurde, ist die Methode "normal" + sal_Int32& rMethodConcept_i = pLocalMethodConcepts[ i ]; + if( !rMethodConcept_i ) + rMethodConcept_i = MethodConcept_NORMAL_IMPL; + pMethodConceptArray[ iAllExportedMethod ] = rMethodConcept_i; + iAllExportedMethod++; + } + if( pMethodTypes[ i ] == ADD_LISTENER_METHOD ) + { + // Klasse des Listeners ermitteln + const Reference& rxMethod = pSourceMethods[i]; + + // void als Default-Klasse eintragen + Reference xListenerClass = TypeToIdlClass( getCppuVoidType(), m_xSMgr ); + // ALT: Reference xListenerClass = Void_getReflection()->getIdlClass(); + + // 1. Moeglichkeit: Parameter nach einer Listener-Klasse durchsuchen + // Nachteil: Superklassen muessen rekursiv durchsucht werden + Sequence< Reference > aParams = rxMethod->getParameterTypes(); + const Reference* pParamArray2 = aParams.getConstArray(); + + Reference xEventListenerClass = TypeToIdlClass( getCppuType( (Reference*) NULL ), m_xSMgr ); + // ALT: Reference xEventListenerClass = XEventListener_getReflection()->getIdlClass(); + sal_Int32 nParamCount = aParams.getLength(); + sal_Int32 k; + for( k = 0 ; k < nParamCount ; k++ ) { - // Klasse des Listeners ermitteln - const Reference& rxMethod = pSourceMethods[i]; - - // void als Default-Klasse eintragen - Reference xListenerClass = TypeToIdlClass( getCppuVoidType(), m_xSMgr ); - // ALT: Reference xListenerClass = Void_getReflection()->getIdlClass(); - - // 1. Moeglichkeit: Parameter nach einer Listener-Klasse durchsuchen - // Nachteil: Superklassen muessen rekursiv durchsucht werden - Sequence< Reference > aParams = rxMethod->getParameterTypes(); - const Reference* pParamArray2 = aParams.getConstArray(); - - Reference xEventListenerClass = TypeToIdlClass( getCppuType( (Reference*) NULL ), m_xSMgr ); - // ALT: Reference xEventListenerClass = XEventListener_getReflection()->getIdlClass(); - sal_Int32 nParamCount = aParams.getLength(); - sal_Int32 k; - for( k = 0 ; k < nParamCount ; k++ ) + const Reference& rxClass = pParamArray2[k]; + + // Sind wir von einem Listener abgeleitet? + if( rxClass->equals( xEventListenerClass ) || + isDerivedFrom( rxClass, xEventListenerClass ) ) { - const Reference& rxClass = pParamArray2[k]; - - // Sind wir von einem Listener abgeleitet? - if( rxClass->equals( xEventListenerClass ) || - isDerivedFrom( rxClass, xEventListenerClass ) ) - { - xListenerClass = rxClass; - break; - } + xListenerClass = rxClass; + break; } - - // 2. Moeglichkeit: Namen der Methode auswerden - // Nachteil: geht nicht bei Test-Listenern, die es nicht gibt - //aMethName = rxMethod->getName(); - //aListenerName = aMethName.Copy( 3, aMethName.Len()-8-3 ); - //Reference xListenerClass = reflection->forName( aListenerName ); - Type aListenerType( TypeClass_INTERFACE, xListenerClass->getName() ); - pListenerClassRefs[ iAllSupportedListener ] = aListenerType; - iAllSupportedListener++; } - } - - // Wenn in diesem Durchlauf XInterface-Methoden - // dabei waren, diese zukuenftig ignorieren - if( bFoundXInterface ) - bXInterfaceIsInvalid = sal_True; - delete[] pMethodTypes; - delete[] pLocalMethodConcepts; + // 2. Moeglichkeit: Namen der Methode auswerden + // Nachteil: geht nicht bei Test-Listenern, die es nicht gibt + //aMethName = rxMethod->getName(); + //aListenerName = aMethName.Copy( 3, aMethName.Len()-8-3 ); + //Reference xListenerClass = reflection->forName( aListenerName ); + Type aListenerType( TypeClass_INTERFACE, xListenerClass->getName() ); + pListenerClassRefs[ iAllSupportedListener ] = aListenerType; + iAllSupportedListener++; + } } - // Super-Klasse(n) vorhanden? Dann dort fortsetzen - Sequence< Reference > aSuperClassSeq = xImplClass2->getSuperclasses(); + // Wenn in diesem Durchlauf XInterface-Methoden + // dabei waren, diese zukuenftig ignorieren + if( bFoundXInterface ) + bXInterfaceIsInvalid = sal_True; - // Zur Zeit wird nur von einer Superklasse ausgegangen - if( aSuperClassSeq.getLength() >= 1 ) - { - xImplClass2 = aSuperClassSeq.getConstArray()[0]; - OSL_ENSURE( xImplClass2.is(), "super class null" ); - } - else - { - xImplClass2 = NULL; - } + delete[] pMethodTypes; + delete[] pLocalMethodConcepts; } - } - - // Anzahl der exportierten Methoden uebernehmen und Sequences anpassen - // (kann abweichen, weil doppelte Methoden erst nach der Ermittlung - // von nExportedMethodCount herausgeworfen werden) - sal_Int32& rMethCount = pAccess->mnMethCount; - rMethCount = iAllExportedMethod; - pAccess->maAllMethodSeq.realloc( rMethCount ); - pAccess->maMethodConceptSeq.realloc( rMethCount ); - // Groesse der Property-Sequences anpassen - pAccess->maAllPropertySeq.realloc( rPropCount ); - pAccess->maPropertyConceptSeq.realloc( rPropCount ); - pAccess->maMapTypeSeq.realloc( rPropCount ); + // Super-Klasse(n) vorhanden? Dann dort fortsetzen + Sequence< Reference > aSuperClassSeq = xImplClass2->getSuperclasses(); - // Ende der Schleife ueber alle vom ClassProvider angegebenen Klassen + // Zur Zeit wird nur von einer Superklasse ausgegangen + if( aSuperClassSeq.getLength() >= 1 ) + { + xImplClass2 = aSuperClassSeq.getConstArray()[0]; + OSL_ENSURE( xImplClass2.is(), "super class null" ); + } + else + { + xImplClass2 = NULL; + } + } } + + // Anzahl der exportierten Methoden uebernehmen und Sequences anpassen + // (kann abweichen, weil doppelte Methoden erst nach der Ermittlung + // von nExportedMethodCount herausgeworfen werden) + sal_Int32& rMethCount = pAccess->mnMethCount; + rMethCount = iAllExportedMethod; + pAccess->maAllMethodSeq.realloc( rMethCount ); + pAccess->maMethodConceptSeq.realloc( rMethCount ); + + // Groesse der Property-Sequences anpassen + pAccess->maAllPropertySeq.realloc( rPropCount ); + pAccess->maPropertyConceptSeq.realloc( rPropCount ); + pAccess->maMapTypeSeq.realloc( rPropCount ); } // Bei structs Fields als Properties registrieren else //if( eType == TypeClass_STRUCT ) diff --git a/stoc/source/invocation/inv.xml b/stoc/source/invocation/inv.xml index a7b71d028f99..11b4f1fec9ef 100644 --- a/stoc/source/invocation/inv.xml +++ b/stoc/source/invocation/inv.xml @@ -63,7 +63,6 @@ XNameContainer and XEnumerationContainer com.sun.star.container.XNameContainer com.sun.star.container.XIndexContainer com.sun.star.reflection.XIdlReflection - com.sun.star.reflection.XIdlClassProvider com.sun.star.reflection.XIdlClass com.sun.star.reflection.XIdlArray com.sun.star.reflection.FieldAccessMode -- cgit