| View previous topic :: View next topic |
| Author |
Message |
strobbekoen
Joined: 16 May 2010 Posts: 3
|
Posted: Sun May 16, 2010 2:19 pm Post subject: hyperlink problem |
|
|
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. |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6607
|
Posted: Sun May 16, 2010 5:43 pm Post subject: |
|
|
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) |
|
| Back to top |
|
 |
strobbekoen
Joined: 16 May 2010 Posts: 3
|
Posted: Mon May 17, 2010 8:38 am Post subject: |
|
|
| It is Delphi 2009 with Richview v11.0.5 |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6607
|
Posted: Mon May 17, 2010 9:14 am Post subject: |
|
|
This problem must be fixed in the latest version.
Now you have access to the protected area and can download it. |
|
| Back to top |
|
 |
strobbekoen
Joined: 16 May 2010 Posts: 3
|
Posted: Mon May 17, 2010 10:08 am Post subject: |
|
|
Thank you, it works with new version.
Appreciate your quick help. |
|
| Back to top |
|
 |
|