Page 1 of 1

hyperlink problem

Posted: Sun May 16, 2010 2:19 pm
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.

Posted: Sun May 16, 2010 5:43 pm
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)

Posted: Mon May 17, 2010 8:38 am
by strobbekoen
It is Delphi 2009 with Richview v11.0.5

Posted: Mon May 17, 2010 9:14 am
by Sergey Tkachenko
This problem must be fixed in the latest version.
Now you have access to the protected area and can download it.

Posted: Mon May 17, 2010 10:08 am
by strobbekoen
Thank you, it works with new version.
Appreciate your quick help.