Skip Menu |

This queue is for tickets about the OpenOffice-OODoc CPAN distribution.

Report information
The Basics
Id: 34162
Status: resolved
Priority: 0/
Queue: OpenOffice-OODoc

People
Owner: Nobody in particular
Requestors: weis [...] kip.uni-heidelberg.de
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 2.035
Fixed in: (no value)



Subject: Error in cellValue with adjacent Zeros
While reading an ods-file there occurs an error when there are adjacent fields containing '0'. It looks like they are treated as just one column: Here is small example: In the example files i created a table with a content like 1 0 0 3 4 5 1 2 3 4 5 6 5 4 3 0 0 1 This is read by the example program like Table has 4 rows and 6 columns row 0 : "" "" "" "" "" "" "" row 1 : "" "1" "0" "3" "4" "5" "" row 2 : "" "1" "2" "3" "4" "5" "6" row 3 : "" "5" "4" "3" "0" "1" "" row 4 : "" "" "" "" "" "" "" I used OpenOffice-OODoc-2.035.tar.gz perl, v5.8.8 built for i486-linux-gnu-thread-multi on linux - debian etch Linux tux 2.6.18-4-686 #1 SMP Wed May 9 23:03:12 UTC 2007 i686 GNU/Linux
Subject: readdata.pl
#!/usr/bin/perl use OpenOffice::OODoc; my $workbook = ooDocument(file => 'data.ods'); my ($rows, $cols) = $workbook->getTableSize(0); print "Table has $rows rows and $cols columns\n"; for ( $row=0; $row<=$rows; $row++ ) { print " row $row : "; for ( $col=0; $col<=$cols; $col++ ) { print ' "' . $workbook->cellValue(0,$row,$col).'"'; } print "\n"; }
It's not a bug, it's a known limitation of the API. As said in the OODoc::Text manual page, getTableSize() can't provide significant results with OOo spreadsheet documents. It makes sense with tables in text documents only. Before addressing individual objects in a spreadsheet, the application must assume and declare rectangular area containing all the targets through getTable(). Your program *must* provide the width and height parameters to getTable() and can't rely on getTableSize() to get them. In other word (and it's an official constraint of the present version), the application must know the size of the table (or portion of table) it wants to use. For more details, see getTable() and/or normalizeTable() in the OpenOffice::OODoc::Text page. Le Lun. Mar. 17 10:44:53 2008, rumo a écrit : Show quoted text
> While reading an ods-file there occurs an error > when there are adjacent fields containing '0'. > It looks like they are treated as just one column: > > Here is small example: > > In the example files i created a table with > a content like > 1 0 0 3 4 5 > 1 2 3 4 5 6 > 5 4 3 0 0 1 > > This is read by the example program like > > Table has 4 rows and 6 columns > row 0 : "" "" "" "" "" "" "" > row 1 : "" "1" "0" "3" "4" "5" "" > row 2 : "" "1" "2" "3" "4" "5" "6" > row 3 : "" "5" "4" "3" "0" "1" "" > row 4 : "" "" "" "" "" "" "" > > > I used > OpenOffice-OODoc-2.035.tar.gz > perl, v5.8.8 built for i486-linux-gnu-thread-multi > on linux - debian etch > Linux tux 2.6.18-4-686 #1 SMP Wed May 9 23:03:12 UTC 2007 i686 GNU/Linux
Acknowledged functional limitation, but not bug. So resolved. However, an automatic spreadsheet sizing and addressing scheme would be appreciated in a future version; ideas are welcome.