Issue 71060 - Filter needs method to iterate over all objects in Writer document in order
Summary: Filter needs method to iterate over all objects in Writer document in order
Status: CONFIRMED
Alias: None
Product: Writer
Classification: Application
Component: programming (show other issues)
Version: OOo 2.0.4
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-01 02:42 UTC by ibshields
Modified: 2013-02-07 22:35 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ibshields 2006-11-01 02:42:49 UTC
Chapter 7 of the developers guide discusses iterating over text in a Writer
document. In particular:

"Paragraphs also have an com.sun.star.container.XEnumerationAccess of their own.
 They can enumerate every single text portion that they contain. A text portion
is a text range containing a uniform piece of information that appears within
the text flow. An ordinary paragraph, formatted in a uniform manner and
containing nothing but a string, enumerates just a single text portion. In a
paragraph that has specially formatted words or other contents, the text portion
enumeration  returns one com.sun.star.text.TextPortion service for each
differently formatted string, and for every other text content. Text portions
include the service com.sun.star.text.TextRange and have the properties listed
below:"

Thus objects anchored at a character, such as graphic objects, can be found in
their logical order by iterating over the containing paragraph, but objects such
as graphic objects, that are anchored at a paragraph are not returned when
iterating over the paragraphs of the document using the code illustration:
       // Here, we access this interface
        XEnumerationAccess xParaAccess = (XEnumerationAccess)
UnoRuntime.queryInterface(
            XEnumerationAccess.class, mxDocText);
        // Call the XEnumerationAccess's only method to access the actual
Enumeration
        XEnumeration xParaEnum = xParaAccess.createEnumeration();
        // While there are paragraphs, do things to them
        while (xParaEnum.hasMoreElements()) {
}

There appears to be no documented method to iterate over all objects in a Writer
document in order as is required for a filter.

Ian
Comment 1 michael.ruess 2006-11-02 10:15:47 UTC
Such a method could be a nice enhancement.