commit c7dd459db682f754f3bdfa8cd9d341ebc90f6533
parent 178552b3c50b5f555dc70b40eac8db3d05f255de
Author: Tomas Hlavaty <tom@logand.com>
Date: Sun, 22 Jan 2012 21:22:25 +0100
minor refactoring
Diffstat:
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/unoidl2java.c b/unoidl2java.c
@@ -165,27 +165,25 @@ static Any find_enum(Any x) {return find(x, enums, matching_enum_p, car);}
static Any find_struct(Any x) {return find(x, structs, matching_struct_p, car);}
static void pr_default_slots(Any slots) {
- // TODO init enum to default
for(Any y = slots; NIL != y; y = cdr(y)) {
Any slot = car(y);
Any n = car(slot);
Any t = cadr(slot);
+ Any e;
switch(kind(consp(t) ? car(t) : t)) {
case STRING: pr(" this."); pp(n); pl(" = \"\";"); break;
case ANY: pr(" this."); pp(n); pl(" = com.sun.star.uno.Any.VOID;"); break;
case TYPE: pr(" this."); pp(n); pl(" = com.sun.star.uno.Type.VOID;"); break;
case SEQUENCE: pr(" this."); pp(n); pr(" = new "); seq0 = 1; pp(t); seq0 = 0; pl(";"); break;
case RELATIVE:
- case ABSOLUTE: {
- Any e = find_enum(t);
- if(NIL != e) {
+ case ABSOLUTE:
+ if(NIL != (e = find_enum(t))) {
Any d = cadr(e);
pr(" this."); pp(n); pl(" = "); pp(t); pr(".");
pp(consp(d) ? car(d) : d); pr(";");
} else if(NIL != (e = find_struct(t))) {
pr(" this."); pp(n); pr(" = new "); pp(t); pl("();");
}
- }
//default: pr("@@@"); print(t); pp(t);
}
}