ValidSelectionUnit

Forms, interaction, unicode

Description

Checks that an TPDFlibFormSelectionUnit value lies between the low and high bounds of the declared enumeration

The check guards the selection APIs against out-of-range values that can reach the session as untyped data, and SetSelectionRange, GetSelectionRange and GetVisualCaretOrder reject such values before converting indexes

Declaration

function ValidSelectionUnit(
  IndexUnit: TPDFlibFormSelectionUnit): Boolean;

Parameters

IndexUnitSelection unit value to validate

Return value

Returns True when the value is one of fsuUTF16CodeUnit, fsuUnicodeCodePoint or fsuGraphemeCluster, otherwise False

See also

TPDFlibFormSelectionUnit, SetSelectionRange, GetSelectionRange, SelectionUnitToUTF16, ValidField