Re: info/CWSImpress67(OOo2.0) : document generator build id available during xml import

Michael Brauer <[email protected]> Wed, 31 Aug 2005 08:12:05 +0200
Newsgroups gmane.comp.openoffice.announce.interface
Message-ID <[email protected]>
Actually, the major and minor version are taken from the 
<meta:generator> element that is described in section 3.1.1 of the 
OpenDocument Specification:

http://www.oasis-open.org/committees/download.php/12573/OpenDocument-v1.0-os.sxw

Its content is specified as follows:

 > The <meta:generator> element contains a string that identifies the
 > application or tool that was used to create or last modify the XML
 > document. This string SHOULD match the definition for user-agents in
 > the HTTP protocol a specified in section 14.43 of [RFC2616]. The
 > generator string SHOULD allow product versions to differ between all
 > released versions of a user agent, for instance by including build ids
 > or patch level information.
 > Conforming applications MAY use the generator string to work around
 > bugs that exist or existed in certain applications, but MUST NOT
 > deliberately implement a different behavior depending on a certain
 > generator string.

This means that "getBuildIDs()" may be used only to detect if a certain 
file has been saved by an OpenOffice.org version that contained an issue 
that caused the file to be non-conforming to the OpenDocument specification.

"getBuildIDs()" must not be used as a replacement for a version number 
stored within files. In particular, it must not be used to change the 
the interpretation of information stored in a file, or to alter 
application behavior. An invalid use case of "getBuildIDs()" for 
instance would be to change the default value for a certain property 
based on the major and minor number returned by "getBuildIDs()".

In any case, "getBuildIDs()" should be used with care, and only if an 
issue within the OpenDocument filter implementation cannot be resolved 
without the knowledge which OOo version saved a document.

Michael


[email protected] wrote:

>    *Type*  	info
> *Title* 	document generator build id available during xml import
> *Posted by* 	[email protected]
> *Affected* 	[email protected],sc,sch,sd,sw,xmloff
> *Effective from* 	CWSImpress67(OOo2.0)
> 
> 
> 
> /*Summary*/
> 
> 
> added
> 
> bool getBuildIds( sal_Int32& rMaster, sal_Int32& rMinor ) const;
> 
> to class
> 
> SvXMLImport
> 
> 
> 
> /*Description*/
> 
> If the import property set contains the string property "BuildId" you
> can use the new method getBuildIds() to get the major and minor
> version of the office that generated the source xml document.
> 
> The method getBuildIds() returns true if the property is available and
> after the meta.xml was importet. For a src680m125 f.e. you get rMaster
> == 680 and rMinor == 125.
> 
> I have added the properties for Sc, Sd, Sw and Sch. This currently
> does not work for embedded objects as they have no meta.xml
> 
> 
>