Index

C/C++ Functions

txTextPasteViaDoc

DT_SLONG txTextPasteViaDoc(DT_TXDOC text_doc, const DT_TXDOC text_doc2, DT_SLONG paste_flags)

Short Description: Paste another text document into current text selection

This function pastes an entire source text document specified by text_doc2 into the active selection of the destination text document specified by text_doc, replacing any currently selected text.

Parameters

ParameterDescription

text_doc

Handle of the associated text document instance. This is the destination text document.

text_doc2

Handle of the text document to be pasted. This is the source text document.

paste_flags

A set of bit values to fine tune the behavior of the function.

  • Bit 0: If unset (0), the funtion does not subsequently run Unicode's implicit bidirectional reordering algorithm on the affected paragraph(s). If set (1), the funtion does subsequently run Unicode's implicit bidirectional reordering algorithm on the affected paragraph(s). In this case the function uses the same font map and the same Unicode flags that were used when the text document was created by calling txTextIniViaStream, txTextIniViaBuffer, txTextMakeViaStream or txTextMakeViaBuffer.
  • Bits 1-31 are reserved for future use. Must be all set to 0.

Return Value

If the function was successful, the return value will be the number of pasted characters. Otherwise, the function returns -1. The function will also return -1 if there are multiple (non-contiguous) or block (rectangular) active selections in the text document.

Comments

This function makes it possible to insert another text document into the active selection of the current text document. The source text can be styled/formatted if required. It is expected that the source text document will represent at least a single paragraph of Unicode text when paste_flags is set to 0.

In order to view the modified text document it is necessary to subsequently call the txTextDraw function.

 

Index