interface XSimpleText in module com::sun::star::text::

(Global Index)

Syntax

interface XSimpleText : com::sun::star::text::XTextRange ;

Description

is the main interface for a distinct text unit, i.e. the main text of a document, the text for headers and footers or for single cells of a table.

See also

XText

Method Summary

createTextCursor

createTextCursorByRange

insertString inserts a string of characters into the text.

insertControlCharacter inserts a control character (like a paragraph break or a hard space) into the text.

Known Services Which Export this Interface

com::sun::star::sheet::CellAnnotation

Method Details



createTextCursor

Syntax

com::sun::star::text::XTextCursor createTextCursor ();

Returns

a new instance of a TextCursor service which can be used to travel in the given text context.

See also

TextCursor

createTextCursorByRange

Syntax

com::sun::star::text::XTextCursor createTextCursorByRange (
com::sun::star::text::XTextRange aTextPosition );

Returns

a new instance of a TextCursor which is located at the specified TextPosition to travel in the given text context.

The initial position is set to aTextPosition .

Parameter aTextPosition

specifies the start position for the new TextCursor .

See also

TextCursor

insertString

Syntax

oneway void insertString (
com::sun::star::text::XTextRange xRange,
string aString,
boolean bAbsorb );

Description

inserts a string of characters into the text.

The string may contain the following white spaces:

  • blank
  • tab
  • cr (which will insert a paragraph break)
  • lf (which will insert a line break)

Parameter xRange

specifies the position of insertion. For example, XSimpleText::createTextCursor can be used to get an XTextRange for this argument.

Parameter aString

specifies the string to insert.

Parameter bAbsorb

specifies whether the text spanned by xRange will be replaced. If true then the content of xRange will be replaced by aString , otherwise aString will be inserted at the end of xRange .

Example

 xText.insertString( xTextCursor, "Hello " + aName$ + ",", false )

 xText.insertControlCharacter( xTextCursor,
 ControlCharacter_PARAGRAPH_BREAK, false );

 xText.insertString( xTextCursor, "more text ...", false )

insertControlCharacter

Syntax

void insertControlCharacter (
com::sun::star::text::XTextRange xRange,
short nControlCharacter,
boolean bAbsorb )
raises ( com::sun::star::lang::IllegalArgumentException );

Description

inserts a control character (like a paragraph break or a hard space) into the text.

See also

ControlCharacter
Top of Page