|
When a style is created in the content part, is automatically a so-called 'automatic style', knowing that only automatic styles are allowed by the standard in this part.
If it's created in the styles part, it may be either 'automatic' or 'named'; the default is 'named'. As a consequence, in this example "SmallCaps" is created as 'automatic' in one case and 'named' in the other case. While it's not a standard requirement, it's possible that OOoWriter deals differently with the two kinds of styles. In order to force the 'automatic' option in the styles part, the instruction could be changed according to the example below:
$styles->createStyle("SmallCaps",
family => 'text',
parent => 'Standard',
category => 'auto',
properties => { 'fo:font-variant' => 'small-caps' }
);
On the other hand, I don't understand why $t (instead of $p) is used as the target of the 2nd to last extendText() calls. The target of extendText() should be a text container (i.e. a paragraph or a heading) and not the retunr value of a previous call of extendText().
|