psrDeleteOperatorInObject
Remove one normalized operator (as indexed in the
BOOL32 __stdcall psrDeleteOperator(IPSR Ctx, uint32_t Index);
BOOL32 __stdcall psrDeleteOperatorInObject(IPSR Ctx, IPDFObj ObjPtr, uint32_t Index);
function psrDeleteOperator(const Ctx: IPSR; Index: Cardinal): LongBool; stdcall;
function psrDeleteOperatorInObject(const Ctx: IPSR; ObjPtr: IPDFObj; Index: Cardinal): LongBool; stdcall;
Purpose. Remove one normalized operator (as indexed in the TContent.OP array returned by psrParsePage) from the parsed page's content, staging the edit for later commit via psrWriteToPage (Interactive Text Search, Selection & Replacement).
Description. Index addresses the normalized operator array (matching Value.Count/Value.OP from psrParsePage), not the raw token stream — per an inline source comment: "deleting a normalized operator removes its whole source-token span from the raw program (e.g. a path's construction+paint tokens), so a re-parse yields exactly one fewer normalized operator." If the normalized-to-raw span mapping (OpSrcFirst/OpSrcLast) doesn't cover Index, a fallback raw-index deletion is attempted instead. psrDeleteOperatorInObject is confirmed to only support page-level content despite its "InObject" name — a non-nil ObjPtr (intended to target a specific nested form/pattern content object) is always rejected, per an explicit comment: "only the page-level program exists here, so a non-nil ObjPtr... is rejected." Both functions are otherwise byte-for-byte identical.
Parameters.
| Parameter | Description |
|---|---|
Ctx | A parser context with a page already parsed via psrParsePage. |
ObjPtr | *(InObject only)* Must be nil — any non-null value fails unconditionally; nested-object-level deletion is not implemented. |
Index | The normalized operator index to remove. |
Return value. True if the deletion was staged; False if no page is parsed, Index is out of range, or (InObject) ObjPtr is non-null.
See also. psrWriteToPage.
C# (P/Invoke)
[return: MarshalAs(UnmanagedType.Bool)]
Misc
psrDeleteOperatorInObject
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.