OpenOffice-OODoc - Re: How to distinguish lists correctly?

Posted on Sat Jun 3 10:45:25 2006 by jstenzel in response to 2373 (See the whole thread of 8)
Re: How to distinguish lists correctly?
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!
Direct Responses: 2408 | Write a response