diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-21 20:23:22 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-21 20:23:22 +0000 |
commit | 52824c91bac6d6cc0f04e242b07d9031477b6362 (patch) | |
tree | 3cafc4ce886f9066b50d4d32bfdda4c5c9f954f4 /protocols/IRCG | |
parent | b4caa062df453412e7cafa5b96afab0b0c3a2940 (diff) |
protocols cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@6170 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IRCG')
-rw-r--r-- | protocols/IRCG/src/options.cpp | 40 |
1 files changed, 13 insertions, 27 deletions
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp index 344df3c89d..fcca7bbc3f 100644 --- a/protocols/IRCG/src/options.cpp +++ b/protocols/IRCG/src/options.cpp @@ -273,32 +273,22 @@ struct { UINT cpId; TCHAR *cpName; } static cpTable[] = static CCtrlCombo* sttCombo;
-typedef BOOL ( WINAPI *pfnGetCPInfoEx )( UINT, DWORD, LPCPINFOEX );
-static pfnGetCPInfoEx fnGetCPInfoEx = NULL;
-
-static BOOL CALLBACK sttLangAddCallback( CHAR* str )
+static BOOL CALLBACK sttLangAddCallback(CHAR *str)
{
UINT cp = atoi(str);
- if ( fnGetCPInfoEx == NULL ) {
- int i;
- for ( i=0; i < SIZEOF(cpTable) && cpTable[i].cpId != cp; i++ );
- if ( i < SIZEOF(cpTable))
- sttCombo->AddString( TranslateTS( cpTable[i].cpName ), cp );
- }
- else {
- CPINFOEX cpinfo;
- if ( fnGetCPInfoEx( cp, 0, &cpinfo )) {
- TCHAR* b = _tcschr( cpinfo.CodePageName, '(' );
- if ( b ) {
- TCHAR* e = _tcsrchr( cpinfo.CodePageName, ')' );
- if ( e ) {
- *e = 0;
- sttCombo->AddString( b+1, cp );
- }
- else sttCombo->AddString( cpinfo.CodePageName, cp );
+ CPINFOEX cpinfo;
+ if (GetCPInfoEx(cp, 0, &cpinfo)) {
+ TCHAR* b = _tcschr( cpinfo.CodePageName, '(' );
+ if ( b ) {
+ TCHAR* e = _tcsrchr( cpinfo.CodePageName, ')' );
+ if ( e ) {
+ *e = 0;
+ sttCombo->AddString( b+1, cp );
}
else sttCombo->AddString( cpinfo.CodePageName, cp );
- } }
+ }
+ else sttCombo->AddString( cpinfo.CodePageName, cp );
+ }
return TRUE;
}
@@ -1058,11 +1048,7 @@ void COtherPrefsDlg::OnInitDialog() m_add.Enable( m_proto->m_perform );
m_delete.Enable( m_proto->m_perform );
- fnGetCPInfoEx = ( pfnGetCPInfoEx )GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "GetCPInfoExW" );
-
- m_codepage.AddString( TranslateT("Default ANSI codepage"), CP_ACP );
- if ( fnGetCPInfoEx == NULL )
- m_codepage.AddString( TranslateT("UTF-8"), CP_UTF8 );
+ m_codepage.AddString(TranslateT("Default ANSI codepage"), CP_ACP);
sttCombo = &m_codepage;
EnumSystemCodePagesA(sttLangAddCallback, CP_INSTALLED);
|