Class ShapeTextBody
The text body of a shape (wps:txbx/w:txbxContent or v:textbox/w:txbxContent). Blocks are live document content owned by the enclosing ShapeRef, so document-wide text extraction and visitor traversal see them.
public sealed class ShapeTextBody : DomNode
- Inheritance
-
ShapeTextBody
- Inherited Members
- Extension Methods
Remarks
This is a DomNode, and that is the whole point of it. The shape tree
above it -- ShapeNode, ShapeGroup, GeometryShape
-- is geometry rather than document content and deliberately stays outside the node graph.
But the blocks inside a text box are document content, and until Phase 44 they were
the only block list in the DOM with no parent. That single missing edge made
IsStale -- which is true whenever Target.Parent is null -- report
true for every tracked change in a text box, so GetRevisions() listed changes that
Accept() and Reject() then refused to apply.
The text body is the parent rather than the ShapeRef because one shape tree can hold many text bodies, and a block's parent has to identify which list it belongs to for removal to work. Its own Parent is the hosting ShapeRef, which is what keeps OwnerDocument resolvable across the non-node shape tree in between.
Constructors
- ShapeTextBody()
Initializes an empty text body.
Properties
- Anchor
Gets or sets where text sits vertically in the inset box.
- Blocks
Gets the block content of the text body.
- Children
Gets this node's children in document order. Nodes without children return an empty list. The list is a live view; mutate through the typed collections (for example Inlines), not through this property.
- Direction
Gets or sets which way the text body reads (a:bodyPr vert).
- InsetBottom
Gets or sets the bottom inset (a:bodyPr bIns), or null for the 45720 EMU default.
- InsetLeft
Gets or sets the left inset (a:bodyPr lIns), or null for the 91440 EMU default.
- InsetRight
Gets or sets the right inset (a:bodyPr rIns), or null for the 91440 EMU default.
- InsetTop
Gets or sets the top inset (a:bodyPr tIns), or null for the 45720 EMU default.
- IsEdited
Gets whether an edit has changed the text since it was read (Phase 162): the DOCX writer then writes the text into the shape's drawing, where an unedited body goes back out exactly as it was read.
- RightToLeft
Gets or sets whether the text body reads right-to-left (a:bodyPr rtlCol).
- Rotation
Gets or sets how far the text is turned within its shape, clockwise in 60000ths of a degree, 0 to under 21600000 (a:bodyPr rot; Phase 181): added to the shape's own turn.
- Upright
Gets or sets whether the text stays upright when the shape is turned (a:bodyPr upright, Word's Do not rotate text; Phase 181): it is laid out in the shape's box turned by the nearest quarter turn.
Methods
- Accept(DomVisitor)
Dispatches to the visitor method for this node's concrete type.
- Clone()
Creates a detached copy. Blocks are cloned through the DOM clone contract.
- CloneCore()
Creates the deep copy for Clone(). Implementations copy all owned state, deep-clone children and copy unknown-XML islands.
- RemoveChildCore(DomNode)
Removes
childfrom this node's child collections.