To test is a TRichViewEdit is empty.
Equivalent of a :
Code: Select all
if (trim(MyTRichEdit.Lines.text)='') then ...
Code: Select all
// look for an equivalent to
function IsRichViewEmpty(ARichView: TCustomRichView): Boolean;
var
LIndex: Integer;
begin
Result := True;
try
for LIndex := 0 to ARichView.ItemCount - 1 do
begin
if (ARichView.GetItemText(LIndex) <> '') then
begin
Result := False;
Exit;
end;
end;
except
end;
end;
Because sometime if the end-user copy an HTML content, select all content of the TRichViewEdit destination , and paste the HTML content (Using CTRL + V or popup with native action), my function seems to return true ?
Something is missing like a validation / post before check if it is empty ?