Subject: | OpenOffice-OODoc-2.102 |
Distribution name: OpenOffice-OODoc-2.102
Perl version: This is perl, v5.8.8 built for i386-linux-thread-multi
OS Info: Fedora release 8 (Werewolf), kernel 2.6.24.7-92.fc8 SMP i686
i686 i386 GNU/Linux
The attached perl program is supposed to create a spreadsheet with the
text "New value" in cell A1 along with the text "Brand new header" in
the page header. This code works just as intended with version 2.035.
In the 2.102 version, the script creates an empty file with no header
and nothing in cell A1.
Subject: | newspreadsheet.pl |
#!/usr/bin/perl
#filename:
#description:
use OpenOffice::OODoc;
$output_file = 'myfile.ods';
my $document = ooDocument
(
file => $output_file,
create => 'spreadsheet'
);
$numlines = 3;
$numcols = 9;
# select & size the 1st (and only) sheet in the document
my $sheet = $document->getTable(0,$numlines,$numcols);
#rename it as the input file (why not ?)
$document->renameTable($sheet, "new name");
$styles = ooDocument(
file => $document,
member =>'styles'
);
$master = $styles->getMasterPageElement('Default');
#set up the page header
$headertext = "Brand new header";#. "\n$currentdate";
$headerpara = $styles->getHeaderParagraph($master,0);
#apply the header
$document->setText($headerpara, $headertext);
$document->cellValue($sheet, 0, 0, "New value");
$document->save;