From a79fa86ed589c3d843baa932230ef08bc7468296 Mon Sep 17 00:00:00 2001 From: Alexey Kulakov Date: Fri, 13 Jul 2012 12:05:09 +0000 Subject: partial code beautifier (through Pascal Analizer) git-svn-id: http://svn.miranda-ng.org/main/trunk@947 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HistoryPlusPlus/hpp_itemprocess.pas | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'plugins/HistoryPlusPlus/hpp_itemprocess.pas') diff --git a/plugins/HistoryPlusPlus/hpp_itemprocess.pas b/plugins/HistoryPlusPlus/hpp_itemprocess.pas index 8ddb7968e7..137fdd28b0 100644 --- a/plugins/HistoryPlusPlus/hpp_itemprocess.pas +++ b/plugins/HistoryPlusPlus/hpp_itemprocess.pas @@ -59,9 +59,9 @@ uses var rtf_ctable_text: AnsiString; -function DoSupportBBCodesHTML(S: AnsiString): AnsiString; -function DoSupportBBCodesRTF(S: AnsiString; StartColor: integer; doColorBBCodes: boolean): AnsiString; -function DoStripBBCodes(S: String): String; +function DoSupportBBCodesHTML(const S: AnsiString): AnsiString; +function DoSupportBBCodesRTF(const S: AnsiString; StartColor: integer; doColorBBCodes: boolean): AnsiString; +function DoStripBBCodes(const S: String): String; function DoSupportSmileys(awParam:WPARAM; alParam: LPARAM): Integer; function DoSupportMathModule(awParam:WPARAM; alParam: LPARAM): Integer; @@ -145,10 +145,9 @@ const MAX_FMTBUF = 4095; var - i: integer; TextBuffer: THppBuffer; -function GetColorRTF(code: AnsiString; colcount: integer): integer; +function GetColorRTF(const code: AnsiString; colcount: integer): integer; var i: integer; begin @@ -271,7 +270,7 @@ begin end; *) -function DoSupportBBCodesRTF(S: AnsiString; StartColor: integer; doColorBBCodes: boolean): AnsiString; +function DoSupportBBCodesRTF(const S: AnsiString; StartColor: integer; doColorBBCodes: boolean): AnsiString; var bufPos,bufEnd: PAnsiChar; strStart,strTrail: PAnsiChar; @@ -357,7 +356,7 @@ begin TextBuffer.Unlock; end; -function DoSupportBBCodesHTML(S: AnsiString): AnsiString; +function DoSupportBBCodesHTML(const S: AnsiString): AnsiString; var bufPos,bufEnd: PAnsiChar; strStart,strTrail,strCode: PAnsiChar; @@ -409,7 +408,7 @@ begin TextBuffer.Unlock; end; -function DoStripBBCodes(S: String): String; +function DoStripBBCodes(const S: String): String; var WideStream: String; i,spos,epos,cpos,slen: integer; @@ -537,10 +536,10 @@ begin end; end; - -initialization - rtf_ctable_text := ''; - +procedure Filltables; +var + i: integer; +begin for i := 0 to High(rtf_ctable) do begin rtf_ctable_text := rtf_ctable_text + AnsiString(format('\red%d\green%d\blue%d;', @@ -556,6 +555,12 @@ initialization bbCodes[i, bbEnd ].prefix.wide := String(bbCodes[i, bbEnd ].prefix.ansi); bbCodes[i, bbEnd ].suffix.wide := String(bbCodes[i, bbEnd ].suffix.ansi); end; +end; + +initialization + rtf_ctable_text := ''; + + FillTables; TextBuffer := THppBuffer.Create; -- cgit v1.2.3