|
I know getTable($tablename, $height, $width) - but what if I don't know height and width (as I described yesterday...)??
And getTableSize: the problem is not, to "get" the empty rows (getTableText truncates empty rows at the end anyway), but the normalization takes much time if you normalize 65536 rows.
Btw. I found that my solution from yesterday does not work properly. It was a little bit rash, to post it, sorry. But I already have a new one ;-) I don't like to patch modules either, but I don't know an other solution. So now I made the following with O::O::Text:
After line 2316 I insert:
#-----------------------------------------------------------------------------
# checks wether a row contains data in any cell (result:0) or not (result:1)
sub _is_empty_row {
my $self = shift;
my $row = shift;
my $cell_values = join('', $self->_get_row_content( $row ) );
if ( $cell_values =~ /\w/si ) {
return 0;
} else {
return 1;
}
}
After line 2339 (now 2355) I insert:
if ( $self->{'truncate_empty_cells'} ) {
while ( $self->_is_empty_row( $rows[$#rows] ) ) {
pop( @rows );
}
}
I Change line 2359 (now 2382) to:
if ( ( $rownum < $length ) && (not $self->{'truncate_empty_cells'}) )
Assuming that the global option 'truncate_empty_cells' set to '1'.
This takes time as well, but not as much as normalizing the whole table. And in respect to yesterday's solution it works ;-)
|