Hi Bernard, > I have developed a small application which scans idl files of the SDK to > collect all enums and constants. All worked well for years until I ran > my application on SDK 2.1 and it bugged on two constants: > com.sun.star.sdb.application.DatabaseObject.TABLE > com.sun.star.sdb.application.DatabaseObject.QUERY > > Looking at the idl, I see that they are defined as equal to another > constant in another IDL, respectively : > com::sun::star::sdb::CommandType::TABLE > com::sun::star::sdb::CommandType::QUERY
I did this intentionally to indicate that the DatabaseObject is, in some sense, a superset of CommandType. > This is the first (and only) case I found in the idl files. > I think it is not wise to create a dependency to another IDL, since the > other constants FORM and REPORT have fixed values (respectively 2 and > 3), which means that the designer knows very well what are the values > for TABLE and QUERY. > Also, I understood that for compatibility reasons an API constant should > not change its value on successive versions of OpenOffice.org. With the same argueing, I'd say that defining DatabaseObjects as CommandTypes is safe, too - they're guaranteed to not change as well. > So, why not simply define these constants as value 0 and 1 ? And > possibly add a comment in the IDL description. Personally, I find comments too ... hidden sometimes. Comments in IDL are very tolerating, you can write there whatever you want, and you can change it anytime without anybody noticing. So I always prefer making things as explicit as possible. That's my personal point of view only, of course. Ciao Frank -- - Frank Schönheit, Software Engineer [EMAIL PROTECTED] - - Sun Microsystems http://www.sun.com/staroffice - - OpenOffice.org Base http://dba.openoffice.org - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]