|
Thank you for this information. So it turns out at the moment there are three formats: OO1, OO2 Transitional, and OO2/OpenDocument, right?
Thinking about this and your last sentence I think the consequence will be that I do not support OO1 and OO2 transitional in my tool, as OpenDocument is more universal (more applications using it) and the former two can be converted into OpenDocument by the free OO2 software.
But it turns out OpenDocument has its pitfalls, too. In my example, I cannot find the style. What's wrong with my code?
# extract document (in content and style parts)
$me->{docContent}=ooDocument(
archive => $me->{archive},
member => 'content',
delimiters => \%delimiters,
);
$me->{docStyles}=ooDocument(
archive => $me->{archive},
member => 'styles',
delimiters => \%delimiters,
);
...
...
# choose an output format according to the type
if ($element->isItemList)
{
# get attributes from style
my $styleName=$me->{docContent}->textStyle($element);
my $styleObject= $me->{docContent}->getStyleElement($styleName)
|| $me->{docStyles}->getStyleElement($styleName);
my %attributes=(defined $styleName) ? $me->{docContent}->getStyleAttributes($styleObject)
: ();
# debug: list results so far
use Data::Dumper;
warn Dumper [
$styleName,
$me->{docContent}->getStyleElement($styleName),
$me->{docStyles}->getStyleElement($styleName),
$styleObject,
\%attributes,
];
...
}
This displays
[OpenOffice::OODoc::Styles::getStyleAttributes] Unknown style
$VAR1 = [
'L1',
undef,
undef,
undef,
{}
];
So, I can find out that the internal style assigned to the bullet point is "L1", but how to find the style object for it?
Thanks in advance!
|