Hi, our ancient c++ class "TimeStamp" (describing who did something and when he did it) from the tools library has a special value for an invalid TimeStamp:
#define TIMESTAMP_INVALID_DATETIME ( DateTime ( Date ( 1, 1, 1601 ), Time ( 0, 0, 0 ) ) ) The whole magic behind that is that 01-01-1601 is taken as an invalid date. I don't know why this date was chosen but perhaps somebody else can shed some light on this. In our UNOIDL we don't have a TimeStamp struct and so usually this is expressed as two attributes, a css.util.DateTime and a string. The IDL documentation says that setting the Day and Month members of the Date to 0 marks the date as "void". This term looks pretty strange to me but I think it means that this is an unspecified date and so it comes close to what we currently express by using our "invalid" TimeStamp. This creates some problems for refactoring code from using C++ classes to UNO services. If the refactored code had an external API that provides a TimeStamp (like our SfxDocumentInfo) we would need to automatically convert the "void" css.util.DateTime to an invalid tools DateTime struct internally. This has the drawback that each DateTime object has to be checked for being "void". Alternatively we could change the definition of TIMESTAMP_INVALID_DATETIME to be compatible with the "void" DateTime from the UNOIDL. This should create problems only in two cases: - somebody treats Day=0 or Month=0 as valid or uses it to express something else - somebody explicitly uses Date(1,1,1601) for whatever reason I would say that we shouldn't care for this (perhaps we could grep for "1601" in the source code) and change TIMESTAMP_INVALID_DATETIME. Opinions, anyone? Ciao, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to "[EMAIL PROTECTED]". I use it for the OOo lists and only rarely read other mails sent to it. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
