WPCubed Product Support

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

#1 ♥ 0
5.2k Views 3 users read 1 min
support

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);

#2 ♥ 0

Is there any workaround for this problem? Or do i have to patch this myself?

Jens

#3 ♥ 0
support

Hi,

I wanted to post a new build quickly, but it is not ready yet.

It would be easier for you simply path that single function, it is just the TEncoding.Unicode which disturbs Your code. Remove it and its fine again.

Julian

#4 ♥ 0
This category is archived. No new posts are possible.