Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: denisjuk [...] op.pl
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in:
  • 2.102
  • 2.103
Fixed in: 2.103



Subject: getTable does not append table rows anymore
procedure getTable does not append new rows to table. Specifically, the following script: use OpenOffice::OODoc::Document; my $doc = new OpenOffice::OODoc::Document(file=>'file',create => 'spreadsheet'); my $t=$doc->getTable(0,100,11); my @Rows=$doc->getTableRows($t); my $Nrows=@Rows; print "N:$Nrows\n"; prints 1, not 100. It was correct in 2.035 version. It looks like the procedure _expand_table in Text module does not consider situation "$rownum < $length". At least, there was a block "if ($rownum < $length)" in 2.035 ==== This is perl, v5.10.0 built for i486-linux-gnu-thread-multi Linux 2.6.25 #1 PREEMPT Mon Jul 28 08:59:58 CEST 2008 i686 GNU/Linux
Le Dim. Aoû. 03 05:57:02 2008, denisjuk a écrit : Show quoted text
> procedure getTable does not append new rows to table. Specifically, the > following script: > > use OpenOffice::OODoc::Document; > my $doc = new OpenOffice::OODoc::Document(file=>'file',create > => 'spreadsheet'); > my $t=$doc->getTable(0,100,11); > my @Rows=$doc->getTableRows($t); > my $Nrows=@Rows; > print "N:$Nrows\n"; > > prints 1, not 100. It was correct in 2.035 version. > > It looks like the procedure _expand_table in Text module does not > consider situation "$rownum < $length". At least, there was a block "if > ($rownum < $length)" in 2.035
There are a few feature changes between 2.035 and 2.103, mainly about tables. Up to 2.035, the normalizeSheet() method, which was automatically triggered by getTable() when size arguments were provided, silently expanded the table when the given size was greater than the existing table size. With 2.103, getTable() can no longer implicitly enlarge the target table. The table expansion feature is now available through the new documented expandTable() (not _expand_table) method, which must be called explicitly. A table can no longer be silently enlarged by getTable(). It's a design choice, knowing that the implicit table expansion through getTable() was an unsafe feature mix (i.e. it could change the content of an object through a "get" method). With 2.103, table expansion and table normalization are deliberately separated. If the application just needs to get a table with direct access to any existing cell (whatever the size),the right accessor is getTable() with the 'normalize' option (without the size arguments). If the application needs to address a restricted area only, the size arguments work the same way as with 2.035. But as soon as the application needs to enlarge a table, it must use expandTable() with the same arguments as getTable() in the "sized" form. As a consequence, this change should not be regarded as a bug. However, the feature can be discussed through the forum and/or the wishlist.