Monday, June 15, 2009

Saving works!

I managed to save the new rsid attribute in ODF i.e. now, I am able to see the rsid values in the content.xml of my .odt files. It is now saved as a signed decimal style but this will be revised soon. Here is a simple example:



<office:document-content office:version="1.2">
<office:scripts/>

<office:font-face-decls>
<style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/>
<style:font-face style:name="Liberation Sans" svg:font-family="'Liberation Sans'" style:font-family-generic="swiss" style:font-pitch="variable"/>
<style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="system" style:font-pitch="variable"/>
</office:font-face-decls>

<office:automatic-styles>

<style:style style:name="T1" style:family="text">
<style:text-properties style:rsid="-965818964"/>
</style:style>
</office:automatic-styles>

<office:body>

<office:texture-mode>

<text:sequence-decls>
<text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
<text:sequence-decl text:display-outline-level="0" text:name="Table"/>
<text:sequence-decl text:display-outline-level="0" text:name="Text"/>
<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
</text:sequence-decls>

<text:p text:style-name="Standard">
<text:span text:style-name="T1">Original text.</text:span>
</text:p>
</office:texture-mode>
</office:body>
</office:document-content>


And after editing the file:



<office:document-content office:version="1.2">
<office:scripts/>

<office:font-face-decls>
<style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/>
<style:font-face style:name="Arial" svg:font-family="Arial" style:font-family-generic="system" style:font-pitch="variable"/>
</office:font-face-decls>

<office:automatic-styles>

<style:style style:name="P1" style:family="paragraph" style:parent-style-name="Standard">
<style:text-properties style:rsid="-965818964"/>
</style:style>

<style:style style:name="T1" style:family="text">
<style:text-properties style:rsid="2141787107"/>
</style:style>
</office:automatic-styles>

<office:body>

<office:texture-mode>

<text:sequence-decls>
<text:sequence-decl text:display-outline-level="0" text:name="Illustration"/>
<text:sequence-decl text:display-outline-level="0" text:name="Table"/>
<text:sequence-decl text:display-outline-level="0" text:name="Text"/>
<text:sequence-decl text:display-outline-level="0" text:name="Drawing"/>
</text:sequence-decls>
<text:p text:style-name="P1">Original text.</text:p>

<text:p text:style-name="P1">
<text:span text:style-name="T1">Added text.</text:span>
</text:p>
</office:texture-mode>
</office:body>
</office:document-content>




However, in most of the cases, pretty strange behavior occurs, so now, I'm trying to fix that. I suspect the problems come from the calls to Insert() when an existing document is opened and from having multiple rsid values for one chunk of text.

No comments:

Post a Comment