Hypertext works in TRichViewEdit and crashes in TRichView

General TRichView support forum. Please post your questions here
Post Reply
Jim Knopf
Posts: 241
Joined: Mon Dec 30, 2013 10:07 pm
Location: Austria
Contact:

Hypertext works in TRichViewEdit and crashes in TRichView

Post by Jim Knopf »

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))

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;
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?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Can you send a project reproducing this error to richviewgmailcom?
Jim Knopf
Posts: 241
Joined: Mon Dec 30, 2013 10:07 pm
Location: Austria
Contact:

Post by Jim Knopf »

Sent you a first shot by mail
Jim Knopf
Posts: 241
Joined: Mon Dec 30, 2013 10:07 pm
Location: Austria
Contact:

Post by Jim Knopf »

Sorry, my mistake: I used two different TRichViewEdits in declaration and code ...
Post Reply