Subject: | getTableText misses some cells unless I call normalizeSheet |
Hi, I'm using OpenOffice::OODoc version 2.236 (which isn't available in
the 'Broken in' field) and Perl 5.10.0.
If you run the attached script (table.pl) passing to it the name of the
attached spreadsheet (table.ods) you will notice that before
normalization the getTableText routine gets 10 cells for the first row
and only 9 for the second. After normalization it gets 10 cells for
each.
The cell it doesn't get is the F2. Note that column F cells have a
validation allowing just a list of values. I guess this has something to
do with the problem.
I read the normalizeSheet documentation but I confess that I didn't
understand if it's just an optimization or if it's required to guarantee
the correct access to the table.
Subject: | table.ods |
Message body not shown because it is not plain text.
Subject: | table.pl |
#!/usr/bin/perl
use strict;
use warnings;
use OpenOffice::OODoc;
use Data::Dumper;
my $file = shift or die;
my $ods = odfDocument(file => $file, part => 'content')
or die "Cannot open file $file\n";
printf "%d, %d, %d\n", $ods->getTableSize(0), scalar($ods->getTableRows(0));
print "Before normalization:\n";
foreach my $row (($ods->getTableText(0))[0,1]) {
print scalar @$row, ': ', Dumper($row);
}
$ods->normalizeSheet(0, 2, 10);
print "\nAfter normalization:\n";
foreach my $row (($ods->getTableText(0))[0,1]) {
print scalar @$row, ': ', Dumper($row);
}