Subject: | repeating cols in spreadsheet are skipped in perl data structure |
Date: | Tue, 22 Apr 2014 20:07:20 -0400 |
To: | <bug-OpenOffice-OODoc [...] rt.cpan.org> |
From: | prof.rueg <smr01270 [...] vtc.vsc.edu> |
I think I found a strange bug in OpenOffice::OODoc when reading in a
LibreOffice Calc Spreadsheet. (LibreOffice version 4.2.3.3 from Ubuntu
Trusty 14.04.)
If the first 2 cols are the same (identical numerics), then a col is
skipped in the perl data structure. Yep, that's it. Weird.
It's totally repeatable. Make a simple spreadsheet and verify. Change
the values in any row so that any number of cols are identically
repeating (numeric or char), and one col will be in the print out. The
repeating cols are skipped.
Worse, is that the once, the repeating value stops, the spreadsheet
column values resume, but in the INCORRECT columns within the perl data
structure.
a1 b1 c1 d1 1
a2 b2 c2 d2 2
a3 b3 c3 d3 3
a4 b4 C4 D4 6
a5 B5 C5 D5 12
#!/usr/bin/perl
use OpenOffice::OODoc;
print "use OpenOffice::OODoc;\n";
my $fn = "test.ods";
my $doc = odfDocument(file => "$fn" );
print "odfDocument(file => '$fn');\n\n";
for my $sheet (qw(0)) {
print "sheet #$sheet\n";
for my $row (1 .. 6){
for my $cell (map("$_$row", (A .. E))) {
print "[$sheet.$cell]=".$doc->getCellValue($sheet,"$cell").", ";
}
print "\n\n";
}
print "\n\n\n\n";
}