diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-08-11 16:34:43 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-08-11 16:34:43 +0200 |
commit | a12affe6e6f7c14303dd8e4c8eec834fe73a5be2 (patch) | |
tree | e231dcb10ddc39b1baedf46e28ff100990e6c5f5 | |
parent | 31dc8b6a853e7334be9431496f94d290d7173e5d (diff) | |
download | fpGUI-a12affe6e6f7c14303dd8e4c8eec834fe73a5be2.tar.xz |
minor code formatting, improved code comments
-rw-r--r-- | docview/components/richtext/RichTextLayoutUnit.pas | 15 | ||||
-rw-r--r-- | docview/components/richtext/RichTextView.pas | 5 |
2 files changed, 4 insertions, 16 deletions
diff --git a/docview/components/richtext/RichTextLayoutUnit.pas b/docview/components/richtext/RichTextLayoutUnit.pas index 491c6f11..f79567e0 100644 --- a/docview/components/richtext/RichTextLayoutUnit.pas +++ b/docview/components/richtext/RichTextLayoutUnit.pas @@ -269,7 +269,7 @@ Var CurrentLine: TLayoutLine; CurrentLinkIndex: longint; WrapX: longint; // X to wrap at - WordX: longint; // width of word so far + WordX: longint; // width of the current word so far P: PChar; NextP: PChar; NextP2: PChar; @@ -362,20 +362,16 @@ ProfileEvent('DEBUG: TRichTextLayout.Layout >>>>'); teLineBreak: begin DoLine( P, NextP, WordStartX + WordX ); - // remember start of line WordStart := NextP; WordX := 0; - P := NextP; - continue; end; teTextEnd: begin DoLine( P, NextP, WordStartX + WordX ); - // end of text, done break; end; @@ -396,7 +392,6 @@ ProfileEvent('DEBUG: TRichTextLayout.Layout >>>>'); WordStarted := true; BitmapHeight := Trunc(Bitmap.Height * FVerticalImageScale); end; - end; teText: @@ -457,7 +452,6 @@ ProfileEvent('DEBUG: TRichTextLayout.Layout >>>>'); // at least not for IPF :) end; { teSetLeftMargin } - else begin // before processing the tag see if font height needs updating @@ -480,11 +474,10 @@ ProfileEvent('DEBUG: TRichTextLayout.Layout >>>>'); P := NextP; continue; // continue loop end; - end; + end; { case CurrentElement.Tag.TagType of... } + end { teStyle } - end - - end; + end; { case CurrentElement.ElementType of... } if OnBreak then begin diff --git a/docview/components/richtext/RichTextView.pas b/docview/components/richtext/RichTextView.pas index fae04180..7440b884 100644 --- a/docview/components/richtext/RichTextView.pas +++ b/docview/components/richtext/RichTextView.pas @@ -673,16 +673,13 @@ begin ProfileEvent('TRichTextView.HandlePaint >>>'); Canvas.ClearClipRect; DrawBorder; -ProfileEvent('DEBUG: TRichTextView.HandlePaint 1'); DrawRect := GetDrawRect; Canvas.Color := BackgroundColor; Canvas.FillRectangle(DrawRect); -ProfileEvent('DEBUG: TRichTextView.HandlePaint 2'); TextRect := GetTextAreaRect; Canvas.SetClipRect(TextRect); -ProfileEvent('DEBUG: TRichTextView.HandlePaint 3'); if InDesigner then begin Canvas.TextColor := clInactiveWgFrame; @@ -701,13 +698,11 @@ ProfileEvent('DEBUG: TRichTextView.HandlePaint 3'); if Length(FText) = 0 then exit; // no need to paint anything further. -ProfileEvent('DEBUG: TRichTextView.HandlePaint 4'); Assert(FLayout <> nil, 'FLayout may not be nil at this point!'); if not Debug then Draw( 0, FLayout.FNumLines ) else Canvas.DrawText(8, 8, GetTextAreaWidth, GetTextAreaHeight{1000}, FText, [txtLeft, txtTop, txtWrap]); -ProfileEvent('DEBUG: TRichTextView.HandlePaint 5'); Canvas.ClearClipRect; if FHScrollbar.Visible and FVScrollbar.Visible then |