|
I hacked a method together. Here it is in case it's any use:
=head2 position
($row, $col) = $table_cell->position;
=cut
*OpenOffice::OODoc::Element::position =
sub
{
my $self = shift;
confess "$self is wrong class"
unless $self->isa('OpenOffice::OODoc::Element');
confess "$self is not a cell (".$self->getName.")"
unless $self->getName eq 'table:table-cell'
or $self->getName eq 'table:covered-table-cell';
# Get column number
#
my $col = 1;
for my $s ( $self->prev_siblings )
{
my $tag = $s->getName;
next unless $tag eq 'table:table-cell'
or $tag eq 'table:covered-table-cell';
my $attr = $s->getAttribute('table:number-columns-repeated');
$col += $attr ? $attr : 1;
}
# Get row number
#
my $row = 1;
for my $s ( $self->parent->prev_siblings )
{
next unless $s->getName eq 'table:table-row';
my $attr = $s->getAttribute('table:number-rows-repeated');
$row += $attr ? $attr : 1;
}
return ($row, $col);
};
It seems to be working for me with my big SS, but no warranty is expressed or implied :) |