Remove "nearest" checkpoint
Posted: Sun Oct 14, 2018 2:17 pm
Hi,
I want to remove the "nearest" checkpoint - meaning the nearest checkpoint going "backwards", but not beyond the current paragraph.
This works for me in a normal document, but does not handle Table cells. How can I also handle table cells with the same logic?
Thanks
I want to remove the "nearest" checkpoint - meaning the nearest checkpoint going "backwards", but not beyond the current paragraph.
Code: Select all
function TForm1.CheckPointNumber(rve: TCustomRichViewEdit): Integer;
var
i: Integer;
begin
Result := -1;
rve := rve.TopLevelEditor;
i := rve.CurItemNo;
while not rve.IsParaStart(i) do
begin
if rve.RVData.GetItemCheckpoint(i) <> nil then
begin
Result := i;
exit;
end;
dec(i);
end;
if rve.RVData.GetItemCheckpoint(i) <> nil then
Result := i;
end;
Code: Select all
procedure TForm1.miRemoveCheckpointClick(Sender: TObject);
begin
if Self.CheckPointNumber(rve) > -1 then
begin
rve.RemoveCheckpointEd(CheckPointNumber(rve));
//rve.Invalidate;
end;
end;
Thanks