|
Please consider the sample script below.
If the "SmallCaps" style is created in the content part
then $t2 ("idem") appears in OOWriter as italicized
small-caps, but if the "SmallCaps" style is created in
the styles part then $t2 appears in OOWriter as
non-small-caps italics, i.e. styles defined in the
content part are additive but styles defined in the
styles part are not. The resulting office:text tree
in content.xml seems to look the same in both cases. I
guess this is by design, but is there any way to make
styles created in the styles part additive?
Cheers,
/BP
use OpenOffice::OODoc;
my $archive = odfContainer('nihil.odt');
my $content = odfDocument(
container => $archive,
part => 'content'
);
my $styles = odfDocument(
container => $archive,
part => 'styles'
);
$content->createStyle("SmallCaps", # Style becomes additive
# $styles->createStyle("SmallCaps", # Style becomes non-additive
family => 'text',
parent => 'Standard',
properties => { 'fo:font-variant' => 'small-caps' }
);
my $p = $content->appendParagraph();
my $t = $content->extendText($p,"alienus","SmallCaps");
my $t1 = $content->extendText($t,"12","Superscript");
my $t2 = $content->extendText($t," idem","Emphasis");
my $t3 = $content->extendText($t," autem");
my $t4 = $content->extendText($p," however");
$archive->save();
|