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

StartIndexZero-based UTF-16 position where the replacement begins
RemovedTextText that the change replaced
InsertedTextText that the change inserted
BeforeAnchor, BeforeCaretDirected selection positions captured before the change
AfterAnchor, AfterCaretDirected selection positions produced by the change

See also

ApplyEditHistory, ApplySelectionEdit, ClearEditHistory, MaxUndoSteps, UndoEdit, RedoEdit, TPDFlibFormSession