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

Posted on Sun May 28 15:17:02 2006 by jstenzel in response to 2369 (See the whole thread of 8)
Re: How to distinguish lists correctly?
1) Yes, OpenDocument is the OO2 format. Therefore, as OO2 *has* GUI buttons that toggle if the current paragraph is part of an ordered or an unordered list, when reading an OpenDocument list OO2 has to distinguish list paragraphs, and therefore it should use a certain pattern for the type decision. Say it treats a bullet prefix style attribute to handle the paragraph as part of a bullet list, and <whatever> prefix style attribute as an indicator that the list is ordered. Likewise, when a user presses the, say, "ordered list" button in OO2, it has to assign that certain prefix style attribute to the list element. So, as there must be an internal mapping in OO2 from prefix style attributes (bullets, numbers, whatever) to list types presented in the GUI (ordered, unordered) and vice versa, I hope I can find out this mapping pattern and use it similarly to detect the list types. Or, I'd be glad to hear about a standard OO2 method or code snippet to do this detection. As an optimization and suggestion, would it be possible to have builtin support of these mappings in the OO::OODoc methods isOrderedList() and isUnorderedList(), so when they detect they are called for an OpenDocument document they switch to that recognition method transparently? 2) I use the isOrderedList() method for a list element to find out its type. And yes, for my test document in OO1 format (exported by OO2), this method always returns true for ordered *and* unordered lists (I can send you the document to your CPAN author address, is this address still valid?). I tracked this down in the Perl debugger and found that finally OO::OODoc::Element::hasTag() returns true for "text:ordered-list", which in fact is what $node->getName() returns for $node. But nevertheless, the list is unordered, so ... ?
Direct Responses: 2373 | Write a response