From 491bbcbcf8de0b8c6b3a94418d27bf4a5cf0db4b Mon Sep 17 00:00:00 2001 From: Graeme Geldenhuys Date: Sun, 24 Jul 2011 19:17:52 +0200 Subject: docview: code formatting improvements. Mainly indentation in case statements. --- docview/components/richtext/RichTextLayoutUnit.pas | 72 +++++++++++----------- 1 file changed, 35 insertions(+), 37 deletions(-) (limited to 'docview/components') diff --git a/docview/components/richtext/RichTextLayoutUnit.pas b/docview/components/richtext/RichTextLayoutUnit.pas index d2cd5ee4..a9ba7b21 100644 --- a/docview/components/richtext/RichTextLayoutUnit.pas +++ b/docview/components/richtext/RichTextLayoutUnit.pas @@ -414,53 +414,53 @@ ProfileEvent('DEBUG: TRichTextLayout.Layout >>>>'); begin case CurrentElement.Tag.TagType of ttBeginLink: - begin - CurrentLinkIndex := FLinks.Add( CurrentElement.Tag.Arguments ); - P := NextP; - continue; - end; + begin + CurrentLinkIndex := FLinks.Add( CurrentElement.Tag.Arguments ); + P := NextP; + continue; + end; ttEndLink: - begin - CurrentLinkIndex := -1; - P := NextP; - continue; - end; + begin + CurrentLinkIndex := -1; + P := NextP; + continue; + end; ttSetLeftMargin: // SPECIAL CASE... could affect display immediately - begin - PerformStyleTag( CurrentElement.Tag, Style, WordstartX + WordX ); - if Style.LeftMargin < WordStartX then begin - // we're already past the margin being set - if pos( 'breakifpast', CurrentElement.Tag.Arguments ) > 0 then + PerformStyleTag( CurrentElement.Tag, Style, WordstartX + WordX ); + if Style.LeftMargin < WordStartX then begin - // this argument means, do a line break - // if the margin is already past - // Seems unusual for most purposes, but needed for IPF rendering. - DoLine( P, NextP, WordStartX + WordX ); + // we're already past the margin being set + if pos( 'breakifpast', CurrentElement.Tag.Arguments ) > 0 then + begin + // this argument means, do a line break + // if the margin is already past + // Seems unusual for most purposes, but needed for IPF rendering. + DoLine( P, NextP, WordStartX + WordX ); - // remember start of line - WordStart := NextP; - WordX := 0; + // remember start of line + WordStart := NextP; + WordX := 0; - P := NextP; + P := NextP; + + continue; + end; + // so ignore it for now. + P := NextP; continue; end; - // so ignore it for now. - P := NextP; - continue; - end; - - // skip across to the new margin - CurrentCharWidth := Style.LeftMargin - WordStartX - WordX; - // BUT! Don't treat it as a space, because you would not - // expect wrapping to take place in a margin change... - // at least not for IPF :) + // skip across to the new margin + CurrentCharWidth := Style.LeftMargin - WordStartX - WordX; + // BUT! Don't treat it as a space, because you would not + // expect wrapping to take place in a margin change... + // at least not for IPF :) - end; { teSetLeftMargin } + end; { teSetLeftMargin } else begin @@ -478,9 +478,7 @@ ProfileEvent('DEBUG: TRichTextLayout.Layout >>>>'); end; end; - PerformStyleTag( CurrentElement.Tag, - Style, - WordX ); + PerformStyleTag( CurrentElement.Tag, Style, WordX ); DisplayedCharsSinceFontChange := false; P := NextP; -- cgit v1.2.3-70-g09d2