Is 'choice' and 'group' in UNO possible?

Stephan Bergmann sbergman at redhat.com
Wed Apr 5 20:19:08 UTC 2023


On 4/5/23 18:47, Regina Henschel wrote:
> In RELAX NG (used for ODF file format) the structure below is possible. 
> Is something similar possible for to define an "enhanced-color" for API? 
> I mean, to have two members, where the data type of the second depends 
> on the value of the first.

UNO does not support sum types.  So you'd need to resort to something 
more ugly, like a struct type with a discriminating member (e.g. an 
enum) plus two further members (of which one or the other would be 
ignored) or (probably more idiomatic) an ANY.



More information about the LibreOffice mailing list