Page 1 of 1

Error when using InsertRTFFromStreamEd

Posted: Fri Jun 29, 2007 8:07 am
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)"

Posted: Tue Jul 03, 2007 4:45 pm
by Sergey Tkachenko
'abc' is not a valid RTF content, so it normal that RTF inserting fails.

Posted: Wed Jul 04, 2007 2:29 am
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?

Posted: Thu Jul 05, 2007 10:03 am
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.

Posted: Fri Jul 06, 2007 2:50 am
by queeniekwan
Thank you!

Posted: Tue Jul 10, 2007 2:26 pm
by Sergey Tkachenko
Uploaded