TRichViewEdit - Appending a File

General TRichView support forum. Please post your questions here
Post Reply
Graham
Posts: 64
Joined: Sun Jan 27, 2013 7:51 pm
Location: Berkshire U.K.

TRichViewEdit - Appending a File

Post by Graham »

This works for RTF, but if you try and append an RVF file, it automatically clears beforehand as you can see below.
Should the "Clear" in this routine be removed to make it consistent with the RTF import?

function TCustomRVData.LoadRVFFromStream(Stream: TStream; var Color: TColor;
Background: TRVBackground; Layout: TRVLayoutInfo
{$IFNDEF RVDONOTUSESTYLETEMPLATES}
; ReadStyleTemplates: TRVStyleTemplateCollection
{$ENDIF}):Boolean;
begin
Clear;
Result := InsertRVFFromStream(Stream,0, Color, Background, Layout, True
{$IFNDEF RVDONOTUSESTYLETEMPLATES}, ReadStyleTemplates{$ENDIF});
end;
Graham
Posts: 64
Joined: Sun Jan 27, 2013 7:51 pm
Location: Berkshire U.K.

Post by Graham »

Actually appending a RVF file to one you have already opened is not done so easily.
Graham
Posts: 64
Joined: Sun Jan 27, 2013 7:51 pm
Location: Berkshire U.K.

Post by Graham »

Forget all previous. Just use "AppendRVFFromStream"
Sergey Tkachenko
Site Admin
Posts: 17564
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

AppendRVFFromStream ignores attributes of the first paragraph in RVF (a style specified in the parameter is used instead).

If you just need to add to the end, use InsertRVFFromStream, pass ItemCount to the Index parameter.
Post Reply