diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-07-24 19:20:35 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2011-07-24 19:20:35 +0200 |
commit | 05c42905925b7890dcc04fa7d261283b58911bfd (patch) | |
tree | 0e39b496583495e09761cea7ed3fdd27d0e4950c /docview/components | |
parent | 491bbcbcf8de0b8c6b3a94418d27bf4a5cf0db4b (diff) | |
download | fpGUI-05c42905925b7890dcc04fa7d261283b58911bfd.tar.xz |
docview: rename paramater so as to prevent confusion with a global variable
Settings is a global variable for RichView component. I renamed the
parameter Settings to ASettings so as to prevent any possible confusion
between the two.
Diffstat (limited to 'docview/components')
-rw-r--r-- | docview/components/richtext/RichTextStyleUnit.pas | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/docview/components/richtext/RichTextStyleUnit.pas b/docview/components/richtext/RichTextStyleUnit.pas index d0351bbf..0749c759 100644 --- a/docview/components/richtext/RichTextStyleUnit.pas +++ b/docview/components/richtext/RichTextStyleUnit.pas @@ -102,7 +102,7 @@ type const Settings: TRichTextSettings; const X: longint ); - function GetDefaultStyle( const Settings: TRichTextSettings ): TTextDrawStyle; + function GetDefaultStyle( const ASettings: TRichTextSettings ): TTextDrawStyle; @@ -290,17 +290,18 @@ ProfileEvent('DEBUG: ApplyStyleTag >>>'); ProfileEvent('DEBUG: ApplyStyleTag <<<'); end; -function GetDefaultStyle( const Settings: TRichTextSettings ): TTextDrawStyle; +function GetDefaultStyle( const ASettings: TRichTextSettings ): TTextDrawStyle; begin FillChar(Result, SizeOf(TTextDrawStyle), 0); - Result.FontNameSize := DefaultTopicFont; + { Note: this references the user Settings and not the parameter ASettings } + Result.FontNameSize := Settings.NormalFontDesc; Result.FontAttributes := []; - Result.Alignment := Settings.FDefaultAlignment; - Result.Wrap := Settings.FDefaultWrap; - Result.Color := Settings.FDefaultColor; - Result.BackgroundColor := Settings.FDefaultBackgroundColor; - Result.LeftMargin := Settings.Margins.Left; - Result.RightMargin := Settings.Margins.Right; + Result.Alignment := ASettings.FDefaultAlignment; + Result.Wrap := ASettings.FDefaultWrap; + Result.Color := ASettings.FDefaultColor; + Result.BackgroundColor := ASettings.FDefaultBackgroundColor; + Result.LeftMargin := ASettings.Margins.Left; + Result.RightMargin := ASettings.Margins.Right; end; @@ -308,8 +309,8 @@ Procedure TRichTextSettings.SetupComponent; begin Name := 'RichTextSettings'; - FNormalFont := fpgGetFont(Settings.NormalFontDesc); // fpgGetFont(DefaultTopicFont); - FFixedFont := fpgGetFont(Settings.FixedFontDesc); // fpgGetFont(DefaultTopicFixedFont); + FNormalFont := fpgGetFont(Settings.NormalFontDesc); + FFixedFont := fpgGetFont(Settings.FixedFontDesc); FHeading1Font := fpgGetFont(DefaultTopicFontName + '-20'); FHeading2Font := fpgGetFont(DefaultTopicFontName + '-14'); FHeading3Font := fpgGetFont(DefaultTopicFontName + '-10:bold'); |