Page 1 of 1

Table's intend is lost after reloading the rtf

Posted: Thu Jul 28, 2011 10:25 pm
by Roliat
Hello - it's me again ;)

Now, I got a problem with tables. When an intendation is set (for a paragraph), and a table is inserted, everything works fine. But after saving and reloading the rtf file the intendation (only) of the table is "0". Why?

Here's my code for saving and reloading

Code: Select all

//Save
function TfrmEditor.GetRTF: String;
var
  ss: TStringStream;
begin
  ss:=TStringStream.Create('');
  try
    ss.Seek(0, soFromBeginning);
    Editor.SaveRTFToStream(ss, false);
    result:=ss.DataString;
  finally
    ss.Free;
  end;
end;

//Read
procedure TfrmEditor.InsertRTF(rtf: string);
var
  ss: TStringStream;
begin
  ss:=TStringStream.Create('');
  try
    ss.Seek(0, soFromBeginning);
    ss.WriteString(rtf);
    ss.Seek(0, soFromBeginning);
    Editor.LoadFromStream(ss, rvynaYes);
    Editor.Format;
    Editor.Modified:=False;
  finally
    ss.Free;
  end;
end;
Please help me. I use TRichView 11.05

Many thanks!

Posted: Fri Jul 29, 2011 7:58 am
by Sergey Tkachenko
It's because you use old version of TRichView

Posted: Fri Jul 29, 2011 9:00 am
by Roliat
Hm ... is there any way to fix this in the source or is an update *really* needed?

Thanks

Posted: Sat Jul 30, 2011 9:46 am
by Sergey Tkachenko
Unfortunately, it requires changes in several places of code, both in RTF saving and writing. I cannot say what changes are needed - we cannot support too old versions.
Send me a private message with details of your order (for example, what email was used), and I'll explain how to get a new version.