Thread

Posted on Tue May 13 18:37:33 2008 by peco
From 2.035 to 2.102 - Incompatibility?
We have done the update from CPAN and now we are not able to update any spreadsheet's cell :-/ We saw the Changelog file but we didn't find any reason there.... Does exists any incompatibility between versions?
Direct Responses: 7865 | Write a response
Posted on Tue May 13 19:49:13 2008 by jmgdoc in response to 7862
Re: From 2.035 to 2.102 - Incompatibility?

Could you post a small code example that shows the issue ?

I have programs that do update spreadsheet's cells with 2.102 in the same way as 2.035...
Direct Responses: 7872 | Write a response
Posted on Wed May 14 13:07:02 2008 by peco in response to 7865
Re: From 2.035 to 2.102 - Incompatibility?
Hello and thank you for your interest!
Here you are a sample code to "delete the first column of the second sheet".
#!/usr/bin/perl -w use OpenOffice::OODoc; use strict; my $oofile=ooFile("./Example-102.ods"); # very basic ODS file with only data at the second sheet. $oofile->{doc}=ooDocument(file=>$oofile,member=>'content'); $oofile->{styles}=ooDocument(file=>$oofile,member=>'styles'); my $sheet2 = $oofile->{doc}->getTable(1, 8, 2); $oofile->{doc}->deleteColumn($sheet2, 0); $oofile->save;

The next code works very well until the 2.102 version.
My platform is:
* OpenOffice 2.4.0
* Perl 5.8.8
* GNU/Linux Ubuntu 8.04

Thanks in advance,
Peco
Direct Responses: 7875 | Write a response
Posted on Wed May 14 16:23:40 2008 by jmgdoc in response to 7872
Re: From 2.035 to 2.102 - Incompatibility?

OK, the target is locked !

The bug is not related to the spreadsheets. It's located at a deeper level.
The program below should work. The "member" options have just been replaced by "part" options.

The "member" option is about to be deprecated. It should be supported for compatibility reasons, but there is a small bug in 2.102, so the "member" option is wrongly ignored in some situations; this bug will be fixed in 2.103, where "member" will be supported again.
In the mean time, the simplest workaround is the use of "part" instead of "member" each time ooDocument() or odfDocument() is called.

Beware: the "ooXxx" method names are themselves deprecated and replaced by "odfXxx", because the official name of the file format is "Open Document Format" and no longer "OpenOffice.org"; for example ooDocument() should be replaced by odfDocument() and so on. However, the old "ooXxx" form remains supported.

#!/usr/bin/perl -w use OpenOffice::OODoc; use strict; my $oofile=ooFile("./Example-102.ods"); # very basic ODS file with only data at the second sheet. $oofile->{doc}=ooDocument(file=>$oofile,part=>'content'); $oofile->{styles}=ooDocument(file=>$oofile,part=>'styles'); my $sheet2 = $oofile->{doc}->getTable(1, 8, 2); $oofile->{doc}->deleteColumn($sheet2, 0); $oofile->save;
Direct Responses: 7876 | Write a response
Posted on Wed May 14 17:04:58 2008 by peco in response to 7875
Re: From 2.035 to 2.102 - Incompatibility?
Perfect, it works!. Thank you!.
Also, I'm introducing the other changes (ooDocument by odfDocument, and so). Thanks again.
Peco
Write a response