Hypertext works in TRichViewEdit and crashes in TRichView
Posted: Thu Feb 13, 2014 8:13 pm
I integrated hyperlinks as shown in the demo 'create hyperlinks'. Works fine there in the TRichViewEdit. If I load the same text inti TRichView, I get an access violation in CRVData because he never gets a valid item (here:
if GetItem(i).GetBoolValueEx(rvbpJump, RVStyle))
In TRichViewEdit are about 56 items, in TRichView only 23. In TRichViewEdit the result is true at the 13th item, in TRichView never. Regardless of UseHypertextStyles in RTFReadProperties is set or not.
Do you have any idea what's going wrong?
if GetItem(i).GetBoolValueEx(rvbpJump, RVStyle))
Code: Select all
procedure TCustomRVFormattedData.GetJumpPointLocation(id: Integer;
var RVData: TCustomRVFormattedData; var ItemNo: Integer);
var i: Integer;
LRVData: TCustomRVData;
RVStyle: TRVStyle;
StoreSub: TRVStoreSubRVData;
item: TCustomRVItemInfo;
begin
RVStyle := GetRVStyle;
RVData := nil;
ItemNo := -1;
for i := 0 to ItemCount-1 do begin
if GetItem(i).GetBoolValueEx(rvbpJump, RVStyle) and
(GetItem(i).JumpID+FirstJumpNo = id) then begin
RVData := Self;
ItemNo := i;
exit;
end;
item := GetItem(i);
LRVData := TCustomRVData(item.GetSubRVData(StoreSub, rvdFirst));
if (LRVData<>nil) then begin
repeat
if LRVData.GetRVData is TCustomRVFormattedData then
TCustomRVFormattedData(LRVData.GetRVData).GetJumpPointLocation(id, RVData, ItemNo);
if RVData<>nil then begin
StoreSub.Free;
exit;
end;
LRVData := TCustomRVData(item.GetSubRVData(StoreSub, rvdNext));
until LRVData=nil;
end;
StoreSub.Free;
end;
end;
Do you have any idea what's going wrong?