I would like to grab the entire tree for a Writer document in OpenOffice 3.1. I need to collect data about all elements of the tree, not just the elements Text.
Loading XTextDocument, and execution getText()will give an element XText. More specifically, using XEnumerationAccessout XTextwill only iterate through TextRange.
From the documentation of OpenOffice / DevGuide / Text / Iterating_over_Text :
The second interface com.sun.star.text.Text is XEnumerationAccess. The text service lists all paragraphs in the text and returns objects that support com.sun.star.text.Paragraph. This includes tables, as the scriptwriter sees the tables as specialized paragraphs that support the com.sun.star.text.TextTable service.
See below for additional documentation:
An enumeration in the text part of a paragraph does not contain content that refers to the paragraph, but does not merge with the text stream. It can be text frames, graphic objects, embedded objects or drawing figures, fixed in a paragraph, symbols or as a symbol. TextPortionType "TextContent" indicates whether the content is bound to a character or as a character. If you have a TextContent part type, you know that form objects are bound to or as a symbol.
My test docs show that I get XTextContent and XTextRange can be obtained via getAnchor(). But how can I determine the type of content that I collect? The only method is getString(). If the object was inline, how can I collect its data?
++, , Java .
- .
.
API.
GrahicObjects . XGraphicObjectsSupplier, getGraphicObjects(). Any getValueTypeName() XTextContent.
API , TextGraphicObject "". ?