From 44b1743298e0e293d105ffb2921f63496341ee41 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Tue, 4 Dec 2012 16:58:07 +0000 Subject: RichTextView can now have Text set even in the constructor phase of a form. Before we were forced to only set text in the OnShow or later. --- docview/components/richtext/RichTextView.pas | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'docview/components/richtext') diff --git a/docview/components/richtext/RichTextView.pas b/docview/components/richtext/RichTextView.pas index 55395709..db8f8d86 100644 --- a/docview/components/richtext/RichTextView.pas +++ b/docview/components/richtext/RichTextView.pas @@ -716,7 +716,9 @@ begin if Length(FText) = 0 then exit; // no need to paint anything further. - Assert(FLayout <> nil, 'FLayout may not be nil at this point!'); + if FLayoutRequired then + // we haven't yet done a layout + Layout; if not Debug then Draw( 0, FLayout.FNumLines ) else -- cgit v1.2.3-70-g09d2