OpenOffice-OODoc - How to distinguish lists correctly?

Posted on Sat May 27 00:22:15 2006 by jstenzel
How to distinguish lists correctly?
Hi, when traversing a document, I wonder how to check the type of a list. The docs say lists have types in OO1, and styles in OO2. But is there an example of how to check them? My current approach is this:
# get element text my $text=$me->{docContent}->getText($element); # choose an output format according to the type if ($element->isItemList) { # a list: try to find out whether this list is ordered or not # (note: only OO 1 distinguishes ordered and unordered lists directly, # OO2 uses generic lists and configures them by style) my $type= $me->{docContent}{opendocument} ? 'oasis' : $element->isOrderedList ? 'ordered' : 'bullet'; # handle all list elements foreach my $item ($me->{docContent}->getItemElementList($element)) {...} }
As you can see, for OO2 I have no idea. For OO1, I use the documented methods, but it turns out that they always report an ordered list, regardless if the list is ordered or not. This was tested with an SXW document (OO1 format), stored by OO 2. Thanks in advance Jochen
Direct Responses: 2367 | Write a response