diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-21 11:11:20 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-21 11:11:20 +0000 |
commit | aa8f4373e0c9614b7d64a5760c0fa071b1c1edc9 (patch) | |
tree | 218b31bc3166dfc36adf55800b7e7cdea17a8c68 /protocols/IcqOscarJ/changeinfo | |
parent | c80bc292b555c6666930790c399f6fac6226c468 (diff) |
- MZeroedObject used instead of the operator new() inlining
- SAFE_DELETE of local objects removed from ICQ
git-svn-id: http://svn.miranda-ng.org/main/trunk@1092 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/changeinfo')
-rw-r--r-- | protocols/IcqOscarJ/changeinfo/changeinfo.h | 2 | ||||
-rw-r--r-- | protocols/IcqOscarJ/changeinfo/dlgproc.cpp | 66 |
2 files changed, 34 insertions, 34 deletions
diff --git a/protocols/IcqOscarJ/changeinfo/changeinfo.h b/protocols/IcqOscarJ/changeinfo/changeinfo.h index 9cb2e37220..ecc4fc3106 100644 --- a/protocols/IcqOscarJ/changeinfo/changeinfo.h +++ b/protocols/IcqOscarJ/changeinfo/changeinfo.h @@ -71,7 +71,7 @@ extern const SettingItem setting[]; extern const int settingCount;
//dlgproc.c
-struct ChangeInfoData : public void_struct
+struct ChangeInfoData : public MZeroedObject
{
HWND hwndDlg;
CIcqProto *ppro;
diff --git a/protocols/IcqOscarJ/changeinfo/dlgproc.cpp b/protocols/IcqOscarJ/changeinfo/dlgproc.cpp index babb269c28..404777aa97 100644 --- a/protocols/IcqOscarJ/changeinfo/dlgproc.cpp +++ b/protocols/IcqOscarJ/changeinfo/dlgproc.cpp @@ -39,17 +39,17 @@ static int DrawTextUtf(HDC hDC, char *text, LPRECT lpRect, UINT uFormat, LPSIZE if (lpSize)
GetTextExtentPoint32W(hDC, tmp, strlennull(tmp), lpSize);
SAFE_FREE((void**)&tmp);
-
+
return res;
}
char* ChangeInfoData::GetItemSettingText(int i, char *buf, size_t bufsize)
{
- char *text = buf;
- int alloced = 0;
+ char *text = buf;
+ int alloced = 0;
- buf[0] = '\0';
+ buf[0] = '\0';
if (settingData[i].value == 0 && !(setting[i].displayType & LIF_ZEROISVALID))
{
@@ -64,7 +64,7 @@ char* ChangeInfoData::GetItemSettingText(int i, char *buf, size_t bufsize) case LI_STRING:
case LI_LONGSTRING:
text = BinaryToEscapes((char*)settingData[i].value);
- alloced = 1;
+ alloced = 1;
break;
case LI_NUMBER:
@@ -78,19 +78,19 @@ char* ChangeInfoData::GetItemSettingText(int i, char *buf, size_t bufsize) {
text = ICQTranslateUtfStatic(LPGEN("Unknown value"), buf, bufsize);
- FieldNamesItem *list = (FieldNamesItem*)setting[i].pList;
- for (int j=0; TRUE; j++)
+ FieldNamesItem *list = (FieldNamesItem*)setting[i].pList;
+ for (int j=0; TRUE; j++)
if (list[j].code == settingData[i].value)
{
text = ICQTranslateUtfStatic(list[j].text, buf, bufsize);
break;
}
- else if (!list[j].text)
- {
- if (list[j].code == settingData[i].value)
- text = ICQTranslateUtfStatic("Unspecified", buf, bufsize);
- break;
- }
+ else if (!list[j].text)
+ {
+ if (list[j].code == settingData[i].value)
+ text = ICQTranslateUtfStatic("Unspecified", buf, bufsize);
+ break;
+ }
}
break;
}
@@ -102,23 +102,23 @@ char* ChangeInfoData::GetItemSettingText(int i, char *buf, size_t bufsize) else
{
if (alloced)
- {
+ {
SAFE_FREE(&text);
- alloced = 0;
- }
- text = "********";
+ alloced = 0;
+ }
+ text = "********";
}
}
- if (text != buf)
- {
- char *tmp = text;
+ if (text != buf)
+ {
+ char *tmp = text;
- text = null_strcpy(buf, text, bufsize - 1);
- if (alloced)
- SAFE_FREE(&tmp);
- }
+ text = null_strcpy(buf, text, bufsize - 1);
+ if (alloced)
+ SAFE_FREE(&tmp);
+ }
- return text;
+ return text;
}
@@ -503,7 +503,7 @@ INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM dat->ClearChangeFlags();
UnhookEvent(dat->hAckHook);
- dat->hAckHook = NULL;
+ dat->hAckHook = NULL;
EnableDlgItem(hwndDlg, IDC_LIST, TRUE);
EnableDlgItem(hwndDlg, IDC_UPLOADING, FALSE);
SetDlgItemTextUtf(hwndDlg, IDC_UPLOADING, ICQTranslateUtfStatic(LPGEN("Upload complete"), str, MAX_PATH));
@@ -517,7 +517,7 @@ INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableDlgItem(hwndDlg, IDC_UPLOADING, FALSE);
SetDlgItemTextUtf(hwndDlg, IDC_UPLOADING, ICQTranslateUtfStatic(LPGEN("Upload FAILED"), str, MAX_PATH));
SendMessage(GetParent(hwndDlg), PSM_FORCECHANGED, 0, 0);
- EnableDlgItem(hwndDlg, IDC_SAVE, TRUE);
+ EnableDlgItem(hwndDlg, IDC_SAVE, TRUE);
}
break;
}
@@ -527,13 +527,13 @@ INT_PTR CALLBACK ChangeInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM UnhookEvent(dat->hAckHook);
dat->hAckHook = NULL;
}
- {
- HFONT hFont = (HFONT)SendMessage(dat->hwndList, WM_GETFONT, 0, 0);
- DeleteObject(hFont);
- }
+ {
+ HFONT hFont = (HFONT)SendMessage(dat->hwndList, WM_GETFONT, 0, 0);
+ DeleteObject(hFont);
+ }
dat->FreeStoredDbSettings();
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
- SAFE_DELETE((void_struct**)&dat);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
+ delete dat;
break;
}
return FALSE;
|