OnReadHyperlink for RVF

General TRichView support forum. Please post your questions here
Post Reply
zet
Posts: 14
Joined: Wed Oct 12, 2005 7:30 am

OnReadHyperlink for RVF

Post by zet »

Hello.

Is it possible to somehow call OnReadHyperlink while pasting RVF?
I need to convert links to my inner form when pasting.
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Sorry, no. RVF is inserted as it is.

You can process OnPaste to paste in hidden RichViewEdit:

Code: Select all

var Stream: TMemoryStream;
begin
  if rveHidden.CanPasteRVF then begin
    rveHidden.PasteRVF;
    <process all items in rveHidden, change tags for links>
    Stream := TMemoryStream.Create;
    rveHidden.SaveRVFToStream(Stream, False);
    Stream.Position := 0;
    TCustomRichViewEdit(Sender).[color=red]InsertRVFFromStreamEd[/color](Stream);
    Stream.Free;
    DoDefault := False;
  end;
end;
Last edited by Sergey Tkachenko on Tue Oct 12, 2010 10:03 am, edited 1 time in total.
zet
Posts: 14
Joined: Wed Oct 12, 2005 7:30 am

Post by zet »

Well, there's no such thing as PasteRVFFromStream.
Did you mean InsertRVFFromStream?
zet
Posts: 14
Joined: Wed Oct 12, 2005 7:30 am

Post by zet »

And another related question.
Is it possible to convert links from my inner representation to plain-text during copying to buffer? Or rvf is also copied as is?
Sergey Tkachenko
Site Admin
Posts: 17555
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

I corrected my code.
Yes, RVF is copied as it is. You can process OnCopy to copy selection in a hidden editor, modify this editor, then call its SelectAll and CopyDef.
zet
Posts: 14
Joined: Wed Oct 12, 2005 7:30 am

Post by zet »

Thank you.
Post Reply