Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: info [...] gwendragon.de
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: Colums missing if fetched with getCellValue
OpenOffice::OOdoc does ignore (adjacent) colums if the contents are the same. Testcase: ========= 1. Put script OO.pl and OpenOffice Calc file oo.ods into one folder 2. Start Linux konsole or DOS Shell 3. Goto folder 4. Start script OO.pl 5. Recognize that the first column is missing in output! Scripts output is: Open './OO.ods' ... Name of Sheet: Tabelle1 Auto;1;;;;;;;;;;;;;; Auto;2;;;;;;;;;;;;;; Auto;3;;;;;;;;;;;;;; Auto;4;;;;;;;;;;;;;; Auto;5;;;;;;;;;;;;;; Auto;6;;;;;;;;;;;;;; Auto;7;;;;;;;;;;;;;; Auto;8;;;;;;;;;;;;;; Auto;9;;;;;;;;;;;;;; Auto;10;;;;;;;;;;;;;; Auto;11;;;;;;;;;;;;;; Auto;12;;;;;;;;;;;;;; Auto;13;;;;;;;;;;;;;; Auto;14;;;;;;;;;;;;;; Auto;15;;;;;;;;;;;;;; This is incorrect! It should be: Open './OO.ods' ... Name of Sheet: Tabelle1 Auto;Auto;1;;;;;;;;;;;;;; Auto;Auto;2;;;;;;;;;;;;;; Auto;Auto;3;;;;;;;;;;;;;; Auto;Auto;4;;;;;;;;;;;;;; Auto;Auto;5;;;;;;;;;;;;;; Auto;Auto;6;;;;;;;;;;;;;; Auto;Auto;7;;;;;;;;;;;;;; Auto;Auto;8;;;;;;;;;;;;;; Auto;Auto;9;;;;;;;;;;;;;; Auto;Auto;10;;;;;;;;;;;;;; Auto;Auto;11;;;;;;;;;;;;;; Auto;Auto;12;;;;;;;;;;;;;; Auto;Auto;13;;;;;;;;;;;;;; Auto;Auto;14;;;;;;;;;;;;;; Auto;Auto;15;;;;;;;;;;;;;; === After analyzing the OpenOffice (OO) file, it seems OO does concatenate two cells with same content into one. This excerpt of the extracted XML code of the file does show it: <table:table-row table:style-name="ro1"> <table:table-cell table:number-columns-repeated="2" office:value- type="string"><text:p>Auto</text:p></table:table-cell> <table:table-cell office:value-type="float" office:value="1"><text:p>1</ text:p></table:table-cell> </table:table-row> Just look at table:number-columns-repeated="2" ==== This sems to be a bug in a module in OpenOffice::OODoc. Or a feature is missing in OpenOffice::OODoc to read such cells. Can you fix this? -- Kind regards from Lilo von Hanffstengel aka GwenDragon
Oh, sorry. It is not a bug. After finding this request https://rt.cpan.org/Public/Bug/Display.html? id=21695 and adding normalizeSheet($tbl, 'full') the script works fine now.
On Fr. 24. Jul. 2009, 13:49:55, info@gwendragon.de wrote: Show quoted text
> Testcase: > ========= > > 1. Put script OO.pl and OpenOffice Calc file oo.ods into one folder
I uploaded two files here in Bugtracker but they disappeared. Now appended them once more.
Download oo.ods
application/vnd.oasis.opendocument.spreadsheet 10.3k

Message body not shown because it is not plain text.

#!/usr/bin/perl $| = 1; use strict; use warnings; use OpenOffice::OODoc; Read_ods_file('./OO.ods'); sub Read_ods_file { my($file) = @_; print "Open '$file' ...\n"; my $doc = odfDocument(file => $file); for (my $i=0; $i<$doc->getTableList();$i++) { my $tbl = $doc->getTable($i); print "Name of Sheet: ".$doc->tableName($tbl)."\n"; for (my $row=0; $row<15; $row++) { my $found = 0; for (my $col=0; $col<15; $col++) { my $v = $doc->getCellValue($tbl, $row, $col); $v = '' if !defined($v); print "$v;"; $found++; } # for print "\n" if $found; } # for } # for } # =pod Output should be: Open './OO.ods' ... Name of Sheet: Tabelle1 Auto;Auto;1;;;;;;;;;;;;;; Auto;Auto;2;;;;;;;;;;;;;; Auto;Auto;3;;;;;;;;;;;;;; Auto;Auto;4;;;;;;;;;;;;;; Auto;Auto;5;;;;;;;;;;;;;; Auto;Auto;6;;;;;;;;;;;;;; Auto;Auto;7;;;;;;;;;;;;;; Auto;Auto;8;;;;;;;;;;;;;; Auto;Auto;9;;;;;;;;;;;;;; Auto;Auto;10;;;;;;;;;;;;;; Auto;Auto;11;;;;;;;;;;;;;; Auto;Auto;12;;;;;;;;;;;;;; Auto;Auto;13;;;;;;;;;;;;;; Auto;Auto;14;;;;;;;;;;;;;; Auto;Auto;15;;;;;;;;;;;;;; But scripts output is: Open './OO.ods' ... Name of Sheet: Tabelle1 Auto;1;;;;;;;;;;;;;; Auto;2;;;;;;;;;;;;;; Auto;3;;;;;;;;;;;;;; Auto;4;;;;;;;;;;;;;; Auto;5;;;;;;;;;;;;;; Auto;6;;;;;;;;;;;;;; Auto;7;;;;;;;;;;;;;; Auto;8;;;;;;;;;;;;;; Auto;9;;;;;;;;;;;;;; Auto;10;;;;;;;;;;;;;; Auto;11;;;;;;;;;;;;;; Auto;12;;;;;;;;;;;;;; Auto;13;;;;;;;;;;;;;; Auto;14;;;;;;;;;;;;;; Auto;15;;;;;;;;;;;;;; This is wrong!
Le Ven. Jul. 24 14:17:04 2009, info@gwendragon.de a écrit : Show quoted text
> On Fr. 24. Jul. 2009, 13:49:55, info@gwendragon.de wrote: >
> > Testcase: > > ========= > > > > 1. Put script OO.pl and OpenOffice Calc file oo.ods into one folder
> > I uploaded two files here in Bugtracker but they disappeared. Now > appended them once more.
OK, the files are present... But the issue is resolved !