OpenOffice-OODoc - Re: empty cell or col bug or feature of getTableText in 2.113 dist?

Posted on Sun Oct 15 16:51:57 2006 by jmgdoc in response to 3258 (See the whole thread of 18)
Re: empty cell or col bug or feature of getTableText in 2.113 dist?
Hopefully, you should not need to patch O::O::Text in order to change the size of the area to be normalized. In order to control this size, you can provide getTable() with the appropriate values as optional arguments. Example:
my $table = $doc->getTable($tablename, $height, $width); my $text = $doc->getTableText($table);

When called with optional size arguments, getTable() automatically calls normalizeSheet() with the given values (and the default size is ignored).
In order to make the table more safe for getTableText(), you could, *after* the code above, delete every possible extra row. Example:
my ($h, $w) = $doc->getTableSize($table); for (my $i = $height ; $i < $h ; $i++) { $doc->deleteRow($table, $i); }

In addition, it's possible to remove the extra cells (if any) in each row in the normalized area, according the difference between the normalized width ($width) and the external width ($w) returned by getTableSize().
Direct Responses: 3263 | Write a response