diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-07-24 19:17:52 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-07-24 19:17:52 +0200 |
commit | 491bbcbcf8de0b8c6b3a94418d27bf4a5cf0db4b (patch) | |
tree | 74032d3266394438e5b869294806e7811570fd83 /docview/components | |
parent | 8dbcc43a7766712dd67c6b3b1d1383c8256c85d3 (diff) | |
download | fpGUI-491bbcbcf8de0b8c6b3a94418d27bf4a5cf0db4b.tar.xz |
docview: code formatting improvements. Mainly indentation in case statements.
Diffstat (limited to 'docview/components')
-rw-r--r-- | docview/components/richtext/RichTextLayoutUnit.pas | 72 |
1 files changed, 35 insertions, 37 deletions
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; |