From e8820cf9945b9ac0546f8d1cac361336f69c9d27 Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Thu, 30 Sep 2010 16:24:34 +0200 Subject: docview: minor code formatting --- docview/components/richtext/RichTextLayoutUnit.pas | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/docview/components/richtext/RichTextLayoutUnit.pas b/docview/components/richtext/RichTextLayoutUnit.pas index 822e8c42..9b684349 100644 --- a/docview/components/richtext/RichTextLayoutUnit.pas +++ b/docview/components/richtext/RichTextLayoutUnit.pas @@ -640,13 +640,12 @@ Var NewMarginX: longint; StartedDrawing: boolean; begin - Line := TLayoutLine(FLines[ LineIndex ]); - P := Line.Text; - EndP := Line.Text + Line.Length; - + Line := TLayoutLine(FLines[ LineIndex ]); + P := Line.Text; + EndP := Line.Text + Line.Length; Style := Line.Style; - FFontManager.SetFont( Style.Font ); + FFontManager.SetFont( Style.Font ); StartedDrawing := false; Link := ''; @@ -830,7 +829,7 @@ begin begin LineHeight := TLayoutLine(FLines[ LineIndex ]).Height; if ( YToFind >= Y ) - and ( YToFind < Y + LineHeight ) then + and ( YToFind < (Y + LineHeight)) then begin // YToFind is within the line Result := tpWithinText; @@ -838,7 +837,7 @@ begin exit; end; - inc( Y, TLayoutLine(FLines[ LineIndex ]).Height ); + inc( Y, LineHeight ); inc( LineIndex ); end; -- cgit v1.2.3-70-g09d2