Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: barries [...] slaysys.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.107
Fixed in: 2.108



Subject: expandTable() doesn't expand columns of first N-1 rows
expandTable() should also add cells to the first N-1 rows when expanding a table of N rows. The following rewrite of expandTable() fixes this. The internal method _expand_table()/_expand_columns() are probably similarly afflicted. sub OpenOffice::OODoc::Text::expandTable2 { my $self = shift; my $table = shift; my $length = shift || 0; my $width = shift || 0; my $context = shift; my ($old_length, $old_width) = $self->getTableSize($table); $table = $self->normalizeSheet($table, 'full'); unless ($table) { warn "[" . __PACKAGE__ . "::expandTable] " . "Unknown or badly formed table\n"; return undef; } my $last_col = $self->getTableColumn($table, -1); my $last_row = $self->getRow($table, -1); my $i = 0; my $j = 0; ## Expand col declarations for ($i = $old_width; $i < $width; $i++) { $last_col = $last_col->replicateNode; } ## Expand existing rows for ($i = 0; $i < $old_length; $i++) { my $row =$self->getRow($table, $i); my $last_cell = $self->getCell($row, -1); for ($j = $old_width; $j < $width; $j++) { $last_cell = $last_cell->replicateNode; } } for ($i = $old_length; $i < $length; $i++) { $last_row = $last_row->replicateNode; } return wantarray ? $self->getTableSize($table) : $table; }
This proposal has been implemented in 2.108. Thanks for your contribution Le Ven. Déc. 26 12:59:40 2008, barries@slaysys.com a écrit : Show quoted text
> expandTable() should also add cells to the first N-1 rows when expanding > a table of N rows. The following rewrite of expandTable() fixes this. > The internal method _expand_table()/_expand_columns() are probably > similarly afflicted. > > sub OpenOffice::OODoc::Text::expandTable2 > { > my $self = shift; > my $table = shift; > my $length = shift || 0; > my $width = shift || 0; > my $context = shift; > > my ($old_length, $old_width) = $self->getTableSize($table); > $table = $self->normalizeSheet($table, 'full'); > unless ($table) > { > warn "[" . __PACKAGE__ . "::expandTable] " . > "Unknown or badly formed table\n"; > return undef; > } > my $last_col = $self->getTableColumn($table, -1); > my $last_row = $self->getRow($table, -1); > my $i = 0; > my $j = 0; > > ## Expand col declarations > for ($i = $old_width; $i < $width; $i++) > { > $last_col = $last_col->replicateNode; > } > > ## Expand existing rows > for ($i = 0; $i < $old_length; $i++) > { > my $row =$self->getRow($table, $i); > my $last_cell = $self->getCell($row, -1); > for ($j = $old_width; $j < $width; $j++) > { > $last_cell = $last_cell->replicateNode; > } > } > > for ($i = $old_length; $i < $length; $i++) > { > $last_row = $last_row->replicateNode; > } > return wantarray ? $self->getTableSize($table) : $table; > } > >