TXLSXStructuralEditRegistry class
TXLSXWorksheet.StructuralEditRegistry coordinates reference-sensitive updates after row or column insertion and deletion
Built-in participants always update HotXLS formulas, names, validations, conditional formats, comments, hyperlinks, drawings, tables, query bindings, scenarios, data tables, print metadata, protected ranges, sparklines, typed pivots, and recognisable preserved extension references
Applications can register ordered participants for their own sheet metadata without replacing the built-in transaction
Declarations
type
TXLSXStructuralEdit = record
RowFrom: Integer;
RowDelta: Integer;
ColFrom: Integer;
ColDelta: Integer;
end;
IXLSXStructuralEditParticipant = interface
procedure ApplyStructuralEdit(Worksheet: TXLSXWorksheet;
const Edit: TXLSXStructuralEdit);
end;
TXLSXStructuralEditRegistry = class
procedure RegisterParticipant(
const Participant: IXLSXStructuralEditParticipant);
procedure UnregisterParticipant(
const Participant: IXLSXStructuralEditParticipant);
procedure Clear;
property Count: Integer;
end;
Edit fields
| RowFrom | First one-based row affected, or zero when rows are unchanged |
| RowDelta | Positive inserted row count or negative deleted row count |
| ColFrom | First one-based column affected, or zero when columns are unchanged |
| ColDelta | Positive inserted column count or negative deleted column count |
Participant rules
- Participants run in registration order after all built-in reference updates
- Registering the same interface more than once has no effect
Countreports only application participants because built-in updates are always active- Participants must not change the registry or start another structural edit from inside the callback
Example
type
TMetadataUpdater = class(TInterfacedObject,
IXLSXStructuralEditParticipant)
public
procedure ApplyStructuralEdit(Worksheet: TXLSXWorksheet;
const Edit: TXLSXStructuralEdit);
end;
Updater := TMetadataUpdater.Create;
Sheet.StructuralEditRegistry.RegisterParticipant(Updater);
Sheet.InsertRows(4, 2);