From 0902cdc3a5413dae6146e4079ec6f76efd96f14f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 20 Feb 2021 12:24:24 +0300 Subject: unused pascal code cleaned --- plugins/Actman/iac_dbrw.pas | 1 - plugins/Actman/iac_inout.pas | 1 - plugins/Actman/iac_jump.pas | 1 - plugins/Actman/iac_program.pas | 1 - plugins/Actman/iac_service.pas | 1 - plugins/HistoryPlusPlus/hpp_contacts.pas | 4 +- plugins/Utils.pas/mircontacts.pas | 131 ------------------------------- 7 files changed, 2 insertions(+), 138 deletions(-) (limited to 'plugins') diff --git a/plugins/Actman/iac_dbrw.pas b/plugins/Actman/iac_dbrw.pas index 5031e5ee7e..4f7a552c21 100644 --- a/plugins/Actman/iac_dbrw.pas +++ b/plugins/Actman/iac_dbrw.pas @@ -315,7 +315,6 @@ var section: array [0..127] of AnsiChar; buf:array [0..31] of WideChar; pc:pAnsiChar; - tmp:pWideChar; lflags,flags2:dword; begin inherited Load(node,fmt); diff --git a/plugins/Actman/iac_inout.pas b/plugins/Actman/iac_inout.pas index 3c65a01219..4b2a694cec 100644 --- a/plugins/Actman/iac_inout.pas +++ b/plugins/Actman/iac_inout.pas @@ -299,7 +299,6 @@ procedure tInOutAction.Load(node:pointer;fmt:integer); var section: array [0..127] of AnsiChar; pc:pAnsiChar; - tmp:pWideChar; flags2:dword; begin inherited Load(node,fmt); diff --git a/plugins/Actman/iac_jump.pas b/plugins/Actman/iac_jump.pas index 53268ea5e3..55bd887ae9 100644 --- a/plugins/Actman/iac_jump.pas +++ b/plugins/Actman/iac_jump.pas @@ -218,7 +218,6 @@ var section: array [0..127] of AnsiChar; buf:array [0..31] of WideChar; pc:pAnsiChar; - tmp:pWideChar; oper,cond:byte; begin inherited Load(node,fmt); diff --git a/plugins/Actman/iac_program.pas b/plugins/Actman/iac_program.pas index 0f7ad393e9..289f1735f6 100644 --- a/plugins/Actman/iac_program.pas +++ b/plugins/Actman/iac_program.pas @@ -201,7 +201,6 @@ procedure tProgramAction.Load(node:pointer;fmt:integer); var section: array [0..127] of AnsiChar; pc:pAnsiChar; - tmp:pWideChar; flags2,lflags:dword; begin inherited Load(node,fmt); diff --git a/plugins/Actman/iac_service.pas b/plugins/Actman/iac_service.pas index fd4a8e8e07..65fffe62aa 100644 --- a/plugins/Actman/iac_service.pas +++ b/plugins/Actman/iac_service.pas @@ -148,7 +148,6 @@ var section:array [0..127] of AnsiChar; buf:array [0..31] of WideChar; pc:pAnsiChar; - tmp:pWideChar; lflags,lflags2:dword; begin inherited Load(node,fmt); diff --git a/plugins/HistoryPlusPlus/hpp_contacts.pas b/plugins/HistoryPlusPlus/hpp_contacts.pas index b66db1d2f2..77a2d5e7d9 100644 --- a/plugins/HistoryPlusPlus/hpp_contacts.pas +++ b/plugins/HistoryPlusPlus/hpp_contacts.pas @@ -51,7 +51,7 @@ uses m_api, hpp_global; -function GetContactDisplayName(hContact: TMCONTACT; Proto: AnsiString = ''; Contact: boolean = false): String; +function GetContactDisplayName(hContact: TMCONTACT; Proto: AnsiString = ''; Contact: boolean = false): WideString; function GetContactProto(hContact: TMCONTACT): AnsiString; overload; function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: AnsiString): AnsiString; overload; function GetContactID(hContact: TMCONTACT; Proto: AnsiString = ''; Contact: boolean = false): AnsiString; @@ -86,7 +86,7 @@ begin end; end; -function GetContactDisplayName(hContact: TMCONTACT; Proto: AnsiString = ''; Contact: boolean = false): String; +function GetContactDisplayName(hContact: TMCONTACT; Proto: AnsiString = ''; Contact: boolean = false): WideString; var RetPWideChar, UW: PChar; begin diff --git a/plugins/Utils.pas/mircontacts.pas b/plugins/Utils.pas/mircontacts.pas index a88a972b70..93e0b0b057 100644 --- a/plugins/Utils.pas/mircontacts.pas +++ b/plugins/Utils.pas/mircontacts.pas @@ -9,14 +9,6 @@ uses //----- Contact info ----- -function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: PAnsiChar): PAnsiChar; overload; -function GetContactDisplayName(hContact: TMCONTACT; Proto: PAnsiChar = nil; Contact: boolean = false): PWideChar; -function GetContactID(hContact: TMCONTACT; Proto: PAnsiChar = nil; Contact: boolean = false): PAnsiChar; - -function GetContactCodePage (hContact: TMCONTACT; Proto: PAnsiChar; var UsedDefault: boolean): Cardinal; overload; -function GetContactCodePage (hContact: TMCONTACT; const Proto: PAnsiChar = nil): Cardinal; overload; -function WriteContactCodePage(hContact: TMCONTACT; CodePage: Cardinal; Proto: PAnsiChar = nil): boolean; - function GetContactStatus(hContact:TMCONTACT):integer; //----- Contact type check ----- @@ -59,129 +51,6 @@ uses //----- Contact info ----- -function GetContactProto(hContact: TMCONTACT; var SubContact: TMCONTACT; var SubProtocol: PAnsiChar): PAnsiChar; -begin - Result := Proto_GetBaseAccountName(hContact); - if StrCmp(Result, META_PROTO)=0 then - begin - SubContact := db_mc_getMostOnline(hContact); - SubProtocol := Proto_GetBaseAccountName(SubContact); - end - else - begin - SubContact := hContact; - SubProtocol := Result; - end; -end; - -function GetContactDisplayName(hContact: TMCONTACT; Proto: PAnsiChar = nil; Contact: boolean = false): PWideChar; -var - pName, pUnk:PWideChar; -begin - if (hContact = 0) and Contact then - StrDupW(Result, TranslateW('Server')) - else - begin - if Proto = nil then - Proto := Proto_GetBaseAccountName(hContact); - pUnk := TranslateW('''(Unknown Contact)'''); - if Proto = nil then - StrDupW(Result, pUnk) - else - begin - pName := Contact_GetInfo(CNF_DISPLAY, hContact, Proto); - if pName <> nil then - begin - if StrCmpW(pName, pUnk)=0 then - AnsiToWide(GetContactID(hContact, Proto), Result, CP_ACP) - else - StrDupW(Result, pName); - mir_free(pName); - end - else - AnsiToWide(GetContactID(hContact, Proto), Result); - - if (Result = nil) or (Result^ = #0) then - AnsiToWide(Translate(Proto), Result, Langpack_GetDefaultCodePage); - end; - end; -end; - -function GetContactID(hContact: TMCONTACT; Proto: PAnsiChar = nil; Contact: boolean = false): PAnsiChar; -var - uid: PAnsiChar; - dbv: TDBVARIANT; - buf: array [0..15] of AnsiChar; - cp: Cardinal; -begin - Result := nil; - if not((hContact = 0) and Contact) then - begin - if Proto = nil then - Proto := Proto_GetBaseAccountName(hContact); - uid := Proto_GetUniqueId(Proto); - if (uid <> nil) then - begin - // db_get_s comparing to DBGetContactSetting don't translate strings - // when uType=0 (DBVT_ASIS) - if db_get_s(hContact, Proto, uid, @dbv, DBVT_ASIS) = 0 then - begin - case dbv._type of - DBVT_BYTE: StrDup(Result, IntToStr(buf,dbv.bVal)); - DBVT_WORD: StrDup(Result, IntToStr(buf,dbv.wVal)); - DBVT_DWORD: StrDup(Result, IntToStr(buf,dbv.dVal)); - DBVT_ASCIIZ: StrDup(Result, dbv.szVal.a); - DBVT_UTF8, - DBVT_WCHAR: begin - cp := Langpack_GetDefaultCodePage; - if dbv._type = DBVT_UTF8 then - UTF8ToAnsi(dbv.szVal.a, Result, cp) - else // dbv._type = DBVT_WCHAR then - WideToAnsi(dbv.szVal.w, Result, cp); - end; - end; - // free variant - db_free(@dbv); - end; - end; - end; -end; - -function GetContactCodePage(hContact: TMCONTACT; Proto: PAnsiChar; var UsedDefault: boolean) : Cardinal; -begin - if Proto = nil then - Proto := Proto_GetBaseAccountName(hContact); - if Proto = nil then - Result := Langpack_GetDefaultCodePage - else - begin - Result := DBReadWord(hContact, Proto, 'AnsiCodePage', $FFFF); - If Result = $FFFF then - Result := DBReadWord(0, Proto, 'AnsiCodePage', CP_ACP); - end; - UsedDefault := (Result = CP_ACP); - if UsedDefault then - Result := GetACP(); -end; - -function GetContactCodePage(hContact: TMCONTACT; const Proto: PAnsiChar = nil): Cardinal; -var - def: boolean; -begin - Result := GetContactCodePage(hContact, Proto, def); -end; - -function WriteContactCodePage(hContact: TMCONTACT; CodePage: Cardinal; Proto: PAnsiChar = nil): boolean; -begin - Result := false; - if Proto = nil then - Proto := Proto_GetBaseAccountName(hContact); - if Proto = nil then - exit; - DBWriteWord(hContact, Proto, 'AnsiCodePage', CodePage); - Result := True; -end; - function GetContactStatus(hContact:TMCONTACT):integer; var szProto:PAnsiChar; -- cgit v1.2.3