When I call the BookmarkLines procedure on a very large document, this procedure takes a lot of time to execute and result in very slow responses.
I have included the source code of this procedure. Is there any way I can speed up this procedure?
Code
procedure TWPCustomRichText.BookmarkLines(const Name: string; var StartL, EndL : PtLine);
var
par: PTParagraph;
lin: PTLine;
a,b,c,d,cp, aTag: Integer;
Const
MoveUp : Boolean = False;
begin
if FMemo.TxtObjLst.Find_CNameList(Name, wpcoBookMark, nil) then
begin
par := nil;
lin := nil;
ATag := TextObjects.FMemo.FindSingleCode(par,Lin,cp,FMemo.TxtObjLst.FindList);
IF Memo.FindCode(False,par,Lin,cp,Atag) <> Nil then begin
StartL := Lin;
IF Memo.FindCode(True,par,Lin,cp,ATag) <> Nil then begin
EndL := Lin;
end
else;
end;
end;
end;
Alles anzeigen