AddEditHistory
Forms, interaction, edit history
Description
Internal helper of TPDFlibFormSession that appends one delta entry to the bounded history of the active edit
Nothing is recorded while MaxUndoSteps is zero or when the removed and inserted text and both directed selection positions are unchanged
Appending first discards the redo branch that follows the current history position, then trims the combined undo and redo entries to MaxUndoSteps
Each entry stores the UTF-16 start index, the removed and inserted text and the anchor and caret positions before and after the change
Declaration
procedure AddEditHistory(StartIndex: Integer;
const RemovedText, InsertedText: WideString;
BeforeAnchor, BeforeCaret, AfterAnchor, AfterCaret: Integer);
Parameters
| StartIndex | Zero-based UTF-16 position where the replacement begins |
|---|---|
| RemovedText | Text that the change replaced |
| InsertedText | Text that the change inserted |
| BeforeAnchor, BeforeCaret | Directed selection positions captured before the change |
| AfterAnchor, AfterCaret | Directed selection positions produced by the change |
See also
ApplyEditHistory, ApplySelectionEdit, ClearEditHistory, MaxUndoSteps, UndoEdit, RedoEdit, TPDFlibFormSession