diff options
author | Jörg Budischewski <jbu@openoffice.org> | 2001-10-26 10:43:05 +0000 |
---|---|---|
committer | Jörg Budischewski <jbu@openoffice.org> | 2001-10-26 10:43:05 +0000 |
commit | 7252942edddda8d9638f3c32792c2e8e91ee169f (patch) | |
tree | 8b979aefccb950964693f8ac92cf7bb2cb37ed6a /ridljar | |
parent | 78cecaf579ef0658e2ba7995cb5faebcb2b209b5 (diff) |
#93678# index structmembers is now taken from generated java-files (jdk14_beta2)
Diffstat (limited to 'ridljar')
5 files changed, 50 insertions, 31 deletions
diff --git a/ridljar/com/sun/star/lib/uno/typedesc/FieldDescription.java b/ridljar/com/sun/star/lib/uno/typedesc/FieldDescription.java index 0d3c5dd2b825..0b3546b4ff0e 100644 --- a/ridljar/com/sun/star/lib/uno/typedesc/FieldDescription.java +++ b/ridljar/com/sun/star/lib/uno/typedesc/FieldDescription.java @@ -2,9 +2,9 @@ * * $RCSfile: FieldDescription.java,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: kr $ $Date: 2001-05-08 09:34:17 $ + * last change: $Author: jbu $ $Date: 2001-10-26 11:43:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,8 +75,8 @@ public class FieldDescription extends MemberTypeInfo implements IFieldDescriptio ITypeDescription _iTypeDescription; Field _field; - FieldDescription(MemberTypeInfo memberTypeInfo, Field field) { - super(memberTypeInfo.getName(), memberTypeInfo.getFlags()); + FieldDescription(String memberName, int memberIndex, int flags, Field field) { + super(memberName, memberIndex, flags); _field = field; } diff --git a/ridljar/com/sun/star/lib/uno/typedesc/TypeDescription.java b/ridljar/com/sun/star/lib/uno/typedesc/TypeDescription.java index 6e5645178ac2..68f146fd34d1 100644 --- a/ridljar/com/sun/star/lib/uno/typedesc/TypeDescription.java +++ b/ridljar/com/sun/star/lib/uno/typedesc/TypeDescription.java @@ -2,9 +2,9 @@ * * $RCSfile: TypeDescription.java,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: kr $ $Date: 2001-09-11 15:57:18 $ + * last change: $Author: jbu $ $Date: 2001-10-26 11:43:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -97,7 +97,7 @@ import com.sun.star.lib.uno.typeinfo.TypeInfo; * methods, which may be changed or moved in the furture, so please * do not use these methods. * <p> - * @version $Revision: 1.12 $ $ $Date: 2001-09-11 15:57:18 $ + * @version $Revision: 1.13 $ $ $Date: 2001-10-26 11:43:05 $ * @author Kay Ramme * @since UDK2.0 */ @@ -773,12 +773,16 @@ public class TypeDescription implements ITypeDescription { TypeInfo typeInfos[] = __getTypeInfos(_class); Field fields[] = _class.getFields(); int index = 0; + int superTypeMemberCount = 0; + if( _superType != null ) + superTypeMemberCount = _superType.getFieldDescriptions().length; + IFieldDescription tmp_iFieldDescriptions[] = new IFieldDescription[fields.length]; Hashtable iFieldDescriptionsByName = new Hashtable(); - - for(int i = 0; i < fields.length; ++ i) { + int i; + for( i = 0; i < fields.length; ++ i) { if((fields[i].getModifiers() & (Modifier.STATIC | Modifier.TRANSIENT)) == 0) { // neither static nor transient ? IFieldDescription iFieldDescription = null; @@ -789,11 +793,15 @@ public class TypeDescription implements ITypeDescription { if(iFieldDescription == null) { MemberTypeInfo memberTypeInfo = __findMemberTypeInfo(typeInfos, fields[i].getName()); - if(memberTypeInfo == null) - memberTypeInfo = new MemberTypeInfo(fields[i].getName(), 0); + if( memberTypeInfo == null ) + throw new com.sun.star.uno.RuntimeException( + TypeDescription.class.getName() + "no membertype info for field " + fields[i].getName(),null ); - - iFieldDescription = new FieldDescription(memberTypeInfo, fields[i]); + iFieldDescription = new FieldDescription( + memberTypeInfo.getName(), + memberTypeInfo.getIndex() + superTypeMemberCount, + memberTypeInfo.getFlags(), + fields[i]); } iFieldDescriptionsByName.put(iFieldDescription.getName(), iFieldDescription); @@ -802,7 +810,10 @@ public class TypeDescription implements ITypeDescription { } IFieldDescription iFieldDescriptions[] = new IFieldDescription[index]; - System.arraycopy(tmp_iFieldDescriptions, 0, iFieldDescriptions, 0, index); + for( i = 0; i < index ; i ++ ) + { + iFieldDescriptions[tmp_iFieldDescriptions[i].getIndex()] = tmp_iFieldDescriptions[i]; + } // transactional assignment _iFieldDescriptions = iFieldDescriptions; diff --git a/ridljar/com/sun/star/lib/uno/typeinfo/MemberTypeInfo.java b/ridljar/com/sun/star/lib/uno/typeinfo/MemberTypeInfo.java index 9661114fcde3..6c9723aebb4d 100644 --- a/ridljar/com/sun/star/lib/uno/typeinfo/MemberTypeInfo.java +++ b/ridljar/com/sun/star/lib/uno/typeinfo/MemberTypeInfo.java @@ -2,9 +2,9 @@ * * $RCSfile: MemberTypeInfo.java,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: jsc $ $Date: 2000-11-08 15:38:23 $ + * last change: $Author: jbu $ $Date: 2001-10-26 11:43:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,9 +63,17 @@ package com.sun.star.lib.uno.typeinfo; public class MemberTypeInfo extends TypeInfo { - public MemberTypeInfo(String name, int flags) + int m_index; + + public MemberTypeInfo(String name, int index, int flags ) { super(name, flags); + m_index = index; + } + + public int getIndex() + { + return m_index; } } diff --git a/ridljar/com/sun/star/uno/IMemberDescription.java b/ridljar/com/sun/star/uno/IMemberDescription.java index d6579866640b..878b2ce267b7 100644 --- a/ridljar/com/sun/star/uno/IMemberDescription.java +++ b/ridljar/com/sun/star/uno/IMemberDescription.java @@ -2,9 +2,9 @@ * * $RCSfile: IMemberDescription.java,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: kr $ $Date: 2001-05-08 09:34:18 $ + * last change: $Author: jbu $ $Date: 2001-10-26 11:43:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,7 +65,7 @@ package com.sun.star.uno; * The <code>IMemberDescription</code> is the base interface * for members of UNO types <code>ITypeDescriptions</code>. * <p> - * @version $Revision: 1.1 $ $ $Date: 2001-05-08 09:34:18 $ + * @version $Revision: 1.2 $ $ $Date: 2001-10-26 11:43:05 $ * @author Kay Ramme * @since UDK3.0 */ @@ -97,4 +97,12 @@ public interface IMemberDescription { * @return the interface state */ boolean isInterface(); + + /** + * Gives the relative index of this member in the declaring + * interface. + * <p> + * @return the realtive index of this member + */ + int getIndex(); } diff --git a/ridljar/com/sun/star/uno/IMethodDescription.java b/ridljar/com/sun/star/uno/IMethodDescription.java index 66184da81e20..99bddc4af05f 100644 --- a/ridljar/com/sun/star/uno/IMethodDescription.java +++ b/ridljar/com/sun/star/uno/IMethodDescription.java @@ -2,9 +2,9 @@ * * $RCSfile: IMethodDescription.java,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: kr $ $Date: 2001-05-08 09:34:18 $ + * last change: $Author: jbu $ $Date: 2001-10-26 11:43:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -69,7 +69,7 @@ import java.lang.reflect.Method; * The <code>IMethodDescription</code> allows to examine a method * in detail. It gives a view to java methods from a UNO point. * <p> - * @version $Revision: 1.1 $ $ $Date: 2001-05-08 09:34:18 $ + * @version $Revision: 1.2 $ $ $Date: 2001-10-26 11:43:05 $ * @author Kay Ramme * @since UDK3.0 */ @@ -83,14 +83,6 @@ public interface IMethodDescription extends IMemberDescription { boolean isOneway(); /** - * Gives the relative index of this method in the declaring - * interface. - * <p> - * @return the realtive index of this method - */ - int getIndex(); - - /** * Indicates if this method is const. * <p> * @return true means it is const. |