Subject: | add_column() fails when used off limits |
The add_column() table method doesn't work properly when the new columns
are inserted before the first one or after the last one.
So the two following instructions fail:
$table->add_column(number => $n); # after the last column
$table->add_column(number => $n, before => 0); # before the 1st
Workarounds:
1) When possible, insert additional columns within the table instead of
before or after the existing columns;
2) If you really need to extend the table after the last existing
column, use add_column() with an explicit 'after' parameter specifying
the last position (-1):
$table->add_column(number => $n, after => -1);
You will get a lot of meaningless warnings "Cell nn out of range" but
the job should be done.
3) If you really need to insert columns before the first one, the
following hack (that replaces the position number of the 1st column by
the 1st column object itself) should work:
my $pos = $table->get_column(0);
$table->add_column(number => $n, before => $pos);
Note: The bug is locked in the development version.