hyperlink problem

General TRichView support forum. Please post your questions here
Post Reply
strobbekoen
Posts: 3
Joined: Sun May 16, 2010 2:09 pm

hyperlink problem

Post by strobbekoen »

Hi,

I am having a problem with hyperlinks.

Here is the scenario I am using :

I have a Form with a TRichView which displays the text. The text comes from RVF format. To edit the text, I open another form with a TRichViewEdit component and copy the text from the viewer to the editor as follows :

procedure TFrameRTFViewer.CopyToEditor(Editor: TRichViewEdit);
var
M: TMemoryStream;
begin
M := TMemoryStream.Create;
try
rvBody.SaveRVFToStream(M, False);
M.Position := 0;
Editor.LoadRVFFromStream(M);
Editor.Reformat;
finally
M.Free;
end;
end;

I then create hyperlinks on the text in the editor. The Target of the hyperlink is formatted in a string as '{guid string};1'

When I click Save , the content is copied back from editor to viewer :

procedure TFrameRTFViewer.CopyFromEditor(Editor: TRichViewEdit);
var
M: TMemoryStream;
begin
M := TMemoryStream.Create;
try
Editor.SaveRVFToStream(M, False);
M.Position := 0;
rvBody.LoadRVFFromStream(M);
rvBody.Reformat;
finally
M.Free;
end;
end;

The problem is that the hyperlinks are not saved correctly.
Both viewer and editor have rvoTagsArePChars = True. RVFOptions are set the same as well.
It seems all hyperlinks receive the same Target tag. However, I debugged the code tracking RVFSaveTag, and they were saved correctly. They just don't load correctly.

Strange problem, I can't figure it out.
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

What version of TRichView and of Delphi?
Version 12.0 had a bug related to tags in Delphi 2009-2010, it was fixed in newer version (available for registered users)
strobbekoen
Posts: 3
Joined: Sun May 16, 2010 2:09 pm

Post by strobbekoen »

It is Delphi 2009 with Richview v11.0.5
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

This problem must be fixed in the latest version.
Now you have access to the protected area and can download it.
strobbekoen
Posts: 3
Joined: Sun May 16, 2010 2:09 pm

Post by strobbekoen »

Thank you, it works with new version.
Appreciate your quick help.
Post Reply