unoidl2

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/unoidl2.git/
Log | Files | Refs

commit d6950c4621ce890915cc56439fa7683c6cacfeaf
parent 9fe59f505ed7465a186a0e7a11f112fa2255d892
Author: Tomas Hlavaty <tom@logand.com>
Date:   Fri, 23 Mar 2012 01:37:37 +0100

pr_default_slot resolves typedefs correctly

Diffstat:
Munoidl2java.c | 43++++++++++++++++++++++++-------------------
1 file changed, 24 insertions(+), 19 deletions(-)

diff --git a/unoidl2java.c b/unoidl2java.c @@ -147,32 +147,37 @@ static Any pr_default_slot(Any slot) { // (sName (string)) Any n = car(slot); Any t = cadr(slot); Any v; - 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: - t = resolve_typedef(cadr(t)); - switch(kind(car(v = get2(t)))) { // TODO only if t is sym2 + if(consp(t)) { // !consp is T in template + switch(kind(car(t))) { + case RELATIVE: + case ABSOLUTE: + t = resolve_typedef(cadr(t)); + if(!consp(t)) t = get2(t); // TODO only if t is not sym2 + } + switch(kind(car(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 TEMPLATE: //(template (absolute com.sun.star.beans.Optional) ((string))) + pr(" "); pp(n); pr(" = new "); pp(cadr(t)); pl("();"); break; + break; case ENUM: - v = cadddr(v); - pr(" this."); pp(n); pr(" = "); pp(t); pr("."); + v = cadddr(t); + pr(" this."); pp(n); pr(" = "); pp(cadr(t)); pr("."); pp(consp(v) ? car(v) : v); pl(";"); break; case STRUCT: - pr(" this."); pp(n); pr(" = new "); pp(t); pl("();"); + pr(" this."); pp(n); pr(" = new "); pp(cadr(t)); pl("();"); break; } - //default: pr("@@@"); print(t); pp(t); } return slot; }