|
The way to control the row height needs a different approach.
Knowing that a row probably uses an existing automatic style (attributed by the spreadsheet editor), and that this style is possibly shared whith one or more other rows, we have to execute the following operations:
1) Normalize the table (according to the appropriate size) in order to ensure that the target row is not a repeated row;
2) Get the existing style of the target row, using rowStyle();
3) Create a new row style using the old one as a prototype, changing the style:row-height and style:use-optimal-row-height attributes only; caution, as long as it's an automatic style, it's hosted in the document content, not in the "styles" member;
3) Replace the old style by the new one using rowStyle() again.
That's all. As an example, the following code works for me; please tell us if it works for you...
my $content = ooDocument(file => "foo.ods", member => "content");
my $table = $content->getTable("Sheet1", 50, 50);
my $row = $content->getRow($table, 0);
my $old_style = $content->rowStyle($row);
$content->createStyle
(
"new_unique_style_name",
prototype => $old_style,
properties =>
{
"style:row-height" => "2cm",
"style:use-optimal-row-height" => "false"
}
);
$content->rowStyle($row, "new_unique_style_name");
$content->save;
|