Function TWPCustomRtfEdit.DeleteParWithCondition(Condition:TWPCheckParagraph) : Boolean
Unit: WPCTRMemo
Class: WPCTRMemo.TWPCustomRtfEdit
Parameters
-
Condition:TWPCheckParagraph
Returns
The type of the result value is Boolean.
Description
This procedure uses a callback procedure to check if a paragraph will be deleted or not.This procedure will also search through the tables on the first level (nested tables are ignored). Inside tables cless are cleared when the condition is true. If the condition is true for all cells in a row that row will be deleted.
function TForm1.Cond(Sender: TObject; par: TParagraph) : Boolean;
begin
Result := par.IsEmpty(true,[],[]);
end;
procedure TForm1.Button10Click(Sender: TObject);
begin
WPRichText1.DeleteParWithCondition(Cond);
WPRichText1.ReformatAll(false, true);
end;