richmemo: manual reading of RTF file

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3732 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
skalogryz
2014-11-16 06:46:18 +00:00
parent bd2ef6579f
commit 23db2b81b2
6 changed files with 135 additions and 55 deletions

View File

@@ -383,13 +383,17 @@ function TCustomRichMemo.LoadRichText(Source: TStream): Boolean;
begin
if not HandleAllocated then HandleNeeded;
if Assigned(Source) and HandleAllocated then begin
Result := TWSCustomRichMemoClass(WidgetSetClass).LoadRichText(Self, Source);
if not Result and Assigned(RTFLoadStream) then begin
if Assigned(RTFLoadStream) then begin
Self.Lines.BeginUpdate;
Self.Lines.Clear;
Result:=RTFLoadStream(Self, Source);
Self.Lines.EndUpdate;
try
Self.Lines.Clear;
Result:=RTFLoadStream(Self, Source);
finally
Self.Lines.EndUpdate;
end;
end;
if not Result then
Result := TWSCustomRichMemoClass(WidgetSetClass).LoadRichText(Self, Source);
end else
Result := false;
end;