tRichView 1.9.24
Sometimes when I load a document I get the following error:
EListError with message 'list index out of bound(0)'
and it looks like it is happening on line 480 of RVThread. After I OK through this error it just loops on
RVThread.pas on line 193 & 194 until I CTRL-F2
It seems to have to do something with LiveSpell but at this point I'm not 100%.
Any ideas on where I should look or what to change?
index error and infinite loop
I did download and install this:
http://www.trichview.com/resources/adrv3/adrv3.zip
Also my Addict Spell checker version is 3.3.1 Pro.
Still got the error, stepping through it I found that the error pops up in CRVFData on line 5910, the GetItemCoords function call.
http://www.trichview.com/resources/adrv3/adrv3.zip
Also my Addict Spell checker version is 3.3.1 Pro.
Still got the error, stepping through it I found that the error pops up in CRVFData on line 5910, the GetItemCoords function call.
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
I am, I am using 1.9.24. I downloaded it yesterday hoping to fix this problem. Was using 1.9.12 before.
I narrowed it down to a LiveSpelling issue. In my OnLoadDocument event I had this code:
if (AddictAutoLiveSpell.LiveSpelling) then
begin
RTFMemoPad.LiveSpellingMode:=rvlspOnChange;
RTFMemoPad.StartLiveSpelling;
end
else
RTFMemoPad.LiveSpellingMode:=rvlspManualStart;
If a document was loaded during the form's oncreate process I would get this error in a document that had a misspelling. So I changed it to this:
if (BHOActivated) and (AddictAutoLiveSpell1.LiveSpelling) then
begin
RTFMemoPad.LiveSpellingMode:=rvlspOnChange;
RTFMemoPad.StartLiveSpelling;
end
else
RTFMemoPad.LiveSpellingMode:=rvlspManualStart;
and in the form's OnActivate method I put this:
procedure TForm1.FormActivate(Sender: TObject);
begin
if not BHOActivated then
begin
if (AddictAutoLiveSpell1.LiveSpelling) then
begin
RTFMemoPad.LiveSpellingMode:=rvlspOnChange;
RTFMemoPad.StartLiveSpelling;
end;
end;
BHOActivated:=true;
end;
This way it wouldn't start the LiveSpell until the form was actually viewable. It isn't very clean but it seems to work. Could the document not have been drawn yet and thus the livespell can't find the word or something like that?
I narrowed it down to a LiveSpelling issue. In my OnLoadDocument event I had this code:
if (AddictAutoLiveSpell.LiveSpelling) then
begin
RTFMemoPad.LiveSpellingMode:=rvlspOnChange;
RTFMemoPad.StartLiveSpelling;
end
else
RTFMemoPad.LiveSpellingMode:=rvlspManualStart;
If a document was loaded during the form's oncreate process I would get this error in a document that had a misspelling. So I changed it to this:
if (BHOActivated) and (AddictAutoLiveSpell1.LiveSpelling) then
begin
RTFMemoPad.LiveSpellingMode:=rvlspOnChange;
RTFMemoPad.StartLiveSpelling;
end
else
RTFMemoPad.LiveSpellingMode:=rvlspManualStart;
and in the form's OnActivate method I put this:
procedure TForm1.FormActivate(Sender: TObject);
begin
if not BHOActivated then
begin
if (AddictAutoLiveSpell1.LiveSpelling) then
begin
RTFMemoPad.LiveSpellingMode:=rvlspOnChange;
RTFMemoPad.StartLiveSpelling;
end;
end;
BHOActivated:=true;
end;
This way it wouldn't start the LiveSpell until the form was actually viewable. It isn't very clean but it seems to work. Could the document not have been drawn yet and thus the livespell can't find the word or something like that?
-
- Site Admin
- Posts: 17557
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
You cannot start live spelling when the TRichViewEdit is not formatted.
You cannot start it in TDBRichViewEdit.OnLoadDocument. This event occurs after the document is loaded, but before it is formatted.
Solutions:
1)
If RTFMemoPad.LiveSpellingMode=rvlspOnChange, live spelling will start after making any change in document.
2)
You can use call RTFMemoPad.StartLiveSpelling in event occuring after the document is loaded and formatted. I think table.AfterScroll can be used.
PS: I opened access to the protected sections of this forum for you account. You can download the latest version there (1.9.24 is not the latest version)
You cannot start it in TDBRichViewEdit.OnLoadDocument. This event occurs after the document is loaded, but before it is formatted.
Solutions:
1)
If RTFMemoPad.LiveSpellingMode=rvlspOnChange, live spelling will start after making any change in document.
2)
You can use call RTFMemoPad.StartLiveSpelling in event occuring after the document is loaded and formatted. I think table.AfterScroll can be used.
PS: I opened access to the protected sections of this forum for you account. You can download the latest version there (1.9.24 is not the latest version)