unoidl2

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

commit 12e715ab9bd62d8a88637972d94f65c87e0df9b6
parent 0d0e2f75a27b2803e29821a5feb1056a8a1da406
Author: Tomas Hlavaty <tom@logand.com>
Date:   Tue, 17 Jan 2012 00:57:07 +0100

initialize default enum slots

Diffstat:
Munoidl2java.c | 18++++++++++++++++++
1 file changed, 18 insertions(+), 0 deletions(-)

diff --git a/unoidl2java.c b/unoidl2java.c @@ -144,6 +144,15 @@ static void pr_args2(Any x) { // for in, out, inout } } +static Any matching_enum_p(Any e, Any x) { + //pr("@@@"); print(e); print(x); + // (relative com sun star uno XInterface)(com sun star uno TypeClass) + // TODO relative (not full) match + return equal(cdr(e), x); +} + +static Any find_enum(Any x) {return find(x, enums, matching_enum_p, car);} + static void pr_default_slots(Any slots) { // TODO init enum to default for(Any y = slots; NIL != y; y = cdr(y)) { @@ -155,6 +164,15 @@ static void pr_default_slots(Any slots) { 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) { + Any d = cadr(e); + pr(" this."); pp(n); pl(" = "); pp(t); pr("."); + pp(consp(d) ? car(d) : d); pr(";"); + } + } //default: pr("@@@"); print(t); pp(t); } }