I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2011-02-07 08:14:33.648264-08 by jmgdoc in response to 13174
Re: Creating Styles for OOCalc through perl

This program doesn't work for several reasons... First: "Times New Roman" is not declared in the target document. A corresponding font face declaration should be provided (in both the styles and content workspaces for more safety). OODoc doesn't presently provide a high-level font face declaration method, but it's possible to import such a declaration from another document or from an XML font spec string; In your current example, the following code should work:
my $xmlfont = '<style:font-face style:name="Times New Roman" ' . 'svg:font-family="Times New Roman" ' . 'style:font-family-generic="roman" style:font-pitch="variable"/>'; $doc->importFontDeclaration($xmlfont); $styles->importFontDeclaration($xmlfont);

Second: The right way to set the text properties of a cell style is the use of the 'area' selector in the 'properties' section.
Every cell style creation in your example should be reworked according to the following template:
printf "-- %s --\n", $styles->createStyle ( "style_$idx", "name" => "style_$idx", "family" => 'table-cell', "properties" => { area => 'text', "font-weight" => "bold", "font-name" => "Times New Roman", }, );

Third: The right instruction to set a cell style is:
$doc->cellStyle($cell, $stylename);

and not:
$doc->style($cell, $stylename);
Direct Responses: Write a response