Error when using InsertRTFFromStreamEd

General TRichView support forum. Please post your questions here
Post Reply
queeniekwan
Posts: 3
Joined: Fri Jun 29, 2007 7:49 am

Error when using InsertRTFFromStreamEd

Post by queeniekwan »

Code: Select all

  RtfStream := TStringStream.Create('abc');
  try
    RtfStream.Seek(0, soFromBeginning);
    IsLoadSuccess := RichViewEdit1.InsertRTFFromStreamEd(RtfStream);
  finally
    RtfStream.Free;
  end;
I am a Delphi programmer and now using Delphi7 and 1.9.15.1 version of RichView.

Coding shown above works fine when Style of RichViewEdit1 is set to a RVStyle and the unicode property of all TextStyle of that RVStyle were set to False.

However, there is EListError when run "InsertRTFFromStreamEd" if I set the unicode property of all TextStyle of that RVStyle to True. The error message is: "List index out of bound(0)"
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

'abc' is not a valid RTF content, so it normal that RTF inserting fails.
queeniekwan
Posts: 3
Joined: Fri Jun 29, 2007 7:49 am

Post by queeniekwan »

But I can insert 'abc' by using InsertRTFFromStreamEd if unicode property of all TextStyle of RVStyle are set to False.

Do you mean that I cannot insert non-RTF content if unicode property of all TextStyle of RVStyle are set to True?
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Actually, it should not be inserted in all cases, both if Unicode=True and if Unicode=False.
But ok, I made change allowing to load plain text content by this method even for Unicode styles. It will be included in the next TRichView update.
queeniekwan
Posts: 3
Joined: Fri Jun 29, 2007 7:49 am

Post by queeniekwan »

Thank you!
Sergey Tkachenko
Site Admin
Posts: 17569
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Uploaded
Post Reply