Posted on 2010-01-26 04:33:28.456023-08 by ads
2.0x --> 2.1x user field behavior change
Hello All,

At $DAYJOB I've recently inherited a codebase using OO::OODoc to insert provided values into fields of existing templates in the OpenOffice 1.0 format. The code (unmaintained for years) is currently running on an old OO::OODoc version 2.011, and does not work correctly on any version newer than than 2.035 (the last in the 2.0x series still available on CPAN). I'd like to get it running on 2.111.

The code basically invokes userFieldValue( $field_name, $new_value ) to set the values of the fields. When using OO::OODoc 2.0x, the field values are visible when viewing the saved .sxw file in OpenOffice.org Writer (tried with several OOo versions, both 2.x and 3.x). When using OO::OODoc 2.1x, the field values are not visible when viewing the saved .sxw file.

In all cases, I can see that the values are actually present in the saved .sxw file, since userFieldValue( $field_name ) returns them, regardless of whether or not the fields are visible in Writer. This leads me to suspect that the behavior I'm seeing is related to styles, and that something has changed in this regard between OO::OODoc 2.0x and 2.1x; but I confess that I'm entirely ignorant the OpenOffice file format and how this stuff hangs together.

Just frobbing, I've tried invoking updateUserFieldReferences( $field ) when running the code under OO::OODoc 2.1x to no avail. Ditto for replacing 'member' with 'part' when creating various doc instances. Both were just clumsy attempts to "modernize" the code based on some initial investigations; obviously I need to delve deeper.

As I work through the learning curve, my workaround for the moment is to simply run the code on OO::OODoc 2.035.

I would be grateful for any enlightenment and/or nudges in the right direction.

Thanks,
-Al
Direct Responses: 12246 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.