RTF (and HTML) is shown as PlainText (V.6.13.3) - Bug?

  • Hello,

    i have upgraded to V 6.13.3 from V.6.08 and D2010.

    Any assignment to WPRichtText.AsString shows the plain Text if I use TextLoadFormat = 'AUTO'.

    Its simple to reproduce.
    - Put a WPRichText on a Form.
    - Create a FormCreate-Event as follows:

    procedure TForm3.FormCreate(Sender: TObject);
    begin
    WPRichText1.AsString := WPRichText1.AsString;
    end;

    Is this a bug or do i something wrong here?

    Andy

    • Offizieller Beitrag

    Hi,

    You are right. This comes from the code

    f := TStringStream.Create(x
    {$IFDEF UNICHAR}
    , TEncoding.Unicode
    {$ENDIF}
    );

    correct would be

    procedure TWPCustomRtfEdit.SetAsString(const x: string);
    var f: TStringStream;
    begin
    BeginUpdate;
    try
    if Pos('unicode', lowercase(TextLoadFormat))=1 then
    f := TStringStream.Create(x
    {$IFDEF UNICHAR}
    , TEncoding.Unicode
    {$ENDIF}
    )
    else
    f := TStringStream.Create(x
    );

    I will change this also at

    procedure TWPCustomRtfEdit.SetSelectionAsString(const x: string);