Subject: | weird behaviour with updateCell on libreoffice spreadsheet |
Date: | Thu, 24 Mar 2016 08:08:06 -0400 |
To: | bug-OpenOffice-OODoc [...] rt.cpan.org |
From: | Andrew Billyard <andrew.billyard [...] gmail.com> |
I'm trying to update a libreoffice spreadsheet (test.ods) with perl's
module OpenOffice::OODoc, and I am coming across spurious behaviour which
I'm not sure if it's from my poor understanding, a bug in OpenOffice::OODoc
or simply an artifact with libreoffice. Here's the test code:
use OpenOffice::OODoc;
my $document=odfDocument(file=>'test.ods');
foreach my $rr (0..10){
$document->updateCell("Sheet1",$rr,0,$rr."0");
}
$document->save;
The code is simply meant to place into column A for the first 10 rows, the
row number followed by a '0' (i.e., '00', '10', '20'...)
*Before* this code is ran, test.ods was blank except for the number 999
placed in cells "C1", "B2 and "F3". The cell "A5" was selected. So roughly,
it looked like:
999
999
999
*After* the perl code was ran, the spreadsheet looked like:
00 00 999
10 999
20 20 20 20 20 999
30 30 30 30 30 30
40 40 40 40 40 40
It seems like the line $document->updateCell(...); does not update just one
cell, but rather all cells on that line, starting at the specified column
and ending at either the first non-black cell or end of spreadsheet's
extent in columns. Also, it only does this to up to row 5, where the cell
is selected, presumably to the spreadsheet's extent in rows.
What I am doing wrong?
-perl version: 5.16.3
-OpenOffice::OODoc version: 2.125
-libreoffice version: 4.1.6.2