EStringListError using RVActions when TRichView is not focus

General TRichView support forum. Please post your questions here
Post Reply
csterg
Posts: 306
Joined: Fri Nov 25, 2005 9:09 pm

EStringListError using RVActions when TRichView is not focus

Post by csterg »

Hello,
i have a really strange error when using the richview actions. If the RichViewEdit does not have the focus when i load a document, then the updating of the actions (that occurs from the OnIdle event) causes an error in the actions code.
The error is almost always a EStringListError message error and i think that it happens for many actions (not just one). I traced the following:

In RichViewActions.pas line 9172 (procedure TrvActionCustomParaListSwitcher.UpdateTarget(Target: TObject);) the following code produces the errror:
...
inherited;
rve := GetControl(Target).TopLevelEditor;
rve.GetSelectionBounds(StartNo, a, EndNo, b, True);
if StartNo<0 then begin
StartNo := rve.CurItemNo;
EndNo := StartNo;
end;
rve.RVData.ExpandToPara(StartNo, EndNo, StartNo, EndNo);
Checked := True;
CorrectListNo := -1;
for i := StartNo to EndNo do
if rve.IsParaStart(i) then begin <--- HERE IS THE ERROR

The problem is that i has the value of -1.

If i create a new project and just drop a trichviewedit and the actions, this error does not occur, nor does it occur in the example app that ships with the actions.

Unfortunately, i have no idea what i am doing wrong. Because this is a handled exception, if i run the app outside the IDE, the app will work (since the exception is handled), but the problem is that whenever the richviewedit looses the focus, the CPU goes to 100% (on a 3GHz PC) -obviously because of the error.

Thanks for any help or tip,
Costas
Sergey Tkachenko
Site Admin
Posts: 17557
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I think the document is not formatted. This is the only reason why this value is -1.
(for example, you cal Load*** without subsequent call of Format)
csterg
Posts: 306
Joined: Fri Nov 25, 2005 9:09 pm

Post by csterg »

This is correct. I was calling the "Reformat" method and not "Format".
It is strange that there was no other 'issue' with the display, everything seemed OK...
Thanks,
Costas
Post Reply