Page 1 of 1

TRichViewEdit - Appending a File

Posted: Fri Feb 22, 2013 12:13 pm
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;

Posted: Fri Feb 22, 2013 1:57 pm
by Graham
Actually appending a RVF file to one you have already opened is not done so easily.

Posted: Fri Feb 22, 2013 2:07 pm
by Graham
Forget all previous. Just use "AppendRVFFromStream"

Posted: Fri Feb 22, 2013 9:29 pm
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.