Speed problem - at the table search - replace operation

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
zekeriye
Posts: 32
Joined: Thu Sep 15, 2005 8:09 pm
Location: Turkey
Contact:

Speed problem - at the table search - replace operation

Post by zekeriye »

Hi;

we used modified scalerv richaction an editor and user free input with our base documents. After loading base documents we cleaning some database related data in the documents. We used this code block to cleaning database related items at the documents.


// Begin code clock
VAR
TopRVData: TCustomRVData;
SelStart1, SelStart2: Integer;
BEGIN
SELSTART1:=0;
SELSTART2:=0;
//

IF EXTRACTFILEEXT(XFILENAME2)='.RVF' THEN
WORDEKF.DOSYAAC_RVF(XFILENAME2) // LOAD RVF
ELSE
WORDEKF.DOSYAAC(XFILENAME2); // LOAD RTF
//
FORMRTF.SCALERV.RICHVIEWEDIT.VISIBLE:=TRUE;
with FORMRTF.SCALERV.RichViewEdit do begin
SetSelectionBounds(0, GetOffsBeforeItem(0), 0, GetOffsBeforeItem(0));
while SearchText('{', [rvseoDown]) do begin
TopRVData := TopLevelEditor.RVData.GetSourceRVData;
SelStart1 := RVGetLinearCaretPos(FORMRTF.SCALERV.RichViewEdit)-1;
if SearchText('}', [rvseoDown]) then begin
if TopRVData = TopLevelEditor.RVData.GetSourceRVData then begin
SelStart2 := RVGetLinearCaretPos(FORMRTF.SCALERV.RichViewEdit);
RVSetSelection(FORMRTF.SCALERV.RichViewEdit, SelStart1, SelStart2-SelStart1);
FORMRTF.SCALERV.RICHVIEWEDIT.INSERTTEXT('');
END
ELSE BEGIN
RVSetLinearCaretPos(FORMRTF.SCALERV.RichViewEdit, SelStart1+1);
END;
end;
end;
end;
FORMRTF.SCALERV.RICHVIEWEDIT.SetSelectionBounds(0, FORMRTF.SCALERV.RICHVIEWEDIT.GetOffsBeforeItem(0), 0, FORMRTF.SCALERV.RICHVIEWEDIT.GetOffsBeforeItem(0));
FORMRTF.SCALERV.RICHVIEWEDIT.VISIBLE:=TRUE;

// end code block //

But if the dcouments is full page table speed is slow. Only one page document processing nearly 5-6 second. Using editör with open (no cleaning data) is very nice nearly one second.

Have got any idea to slove this problem?

I am send an example document at [email protected] and screenshot after clenaing database related items. At this document the cleaning time is 6 second.

PS : most all of the documents are RVF format
Sergey Tkachenko
Site Admin
Posts: 17253
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

You can do field replacement much faster without SearchText method.
See http://www.trichview.com/forums/viewtopic.php?t=8 , it had example with fields defined by {} characters.
Post Reply