commit 86591d393a136742f5e4683aa642ef99f7b76ac7
parent 8f4fc49140f534ef6de2788127b441850a0cd9e4
Author: Tomas Hlavaty <tom@logand.com>
Date: Sat, 14 Apr 2012 23:09:09 +0200
fix in parameter TypeInfo
Diffstat:
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/unoidl2java.c b/unoidl2java.c
@@ -274,6 +274,7 @@ static void pr_TypeInfo2(_Kind _kind, Any name, Any type, int flags, int *i, int
case _ATTRIBUTE:
case _MEMBER:
case _METHOD:
+ case _PARAMETER:
switch(kind(car(type))) {
case SEQUENCE:
case TEMPLATE:
@@ -294,10 +295,6 @@ static void pr_TypeInfo2(_Kind _kind, Any name, Any type, int flags, int *i, int
}
}
}
- switch(_kind) {
- case _METHOD:
- // TODO _PARAMETER
- }
}
pr(")");
}
@@ -329,6 +326,20 @@ static int type_flags(Any x) {
return 0;
}
+static int type_template(Any x) {
+ if(consp(x)) {
+ switch(kind(car(x))) {
+ case TEMPLATE: return 1;
+ case SEQUENCE: return type_template(cadr(x));
+ case RELATIVE:
+ case ABSOLUTE:
+ x = resolve_typedef(cadr(x), 0);
+ return com_sun_star_uno_XInterface == x ? 0 : type_template(x);
+ }
+ }
+ return 0;
+}
+
static Any kindeq(Kind k, Any a) {return k == kind(a) ? T : NIL;}
static Any readonlyp(Any a) {return kindeq(READONLY, a);}
@@ -362,7 +373,7 @@ static Any pr_TypeInfo1(void *env, Any x) {
case IN: // (in aType (type))
t = caddr(x);
f |= _IN | type_flags(t);
- if(f != _IN && f != (_IN | _ANY))
+ if((f != _IN && f != (_IN | _ANY)) || type_template(t))
pr_TypeInfo2(_PARAMETER, cadr(x), t, f, env, 0);
else
++*((int *) env);