diff options
author | George Hazan <george.hazan@gmail.com> | 2012-12-18 18:24:23 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-12-18 18:24:23 +0000 |
commit | 380664004b21439985f148faaec988b0f28dc489 (patch) | |
tree | c25a177a35e0f763d068ac37f7196cbd9cc6e155 /plugins/DbEditorPP/src/copymodule.cpp | |
parent | 4051b9c5d1ac642751983cc0da7f5f991bbea474 (diff) |
- crash fix for Win64 builds;
- some unneeded Unicode stuff wiped out
git-svn-id: http://svn.miranda-ng.org/main/trunk@2762 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/DbEditorPP/src/copymodule.cpp')
-rw-r--r-- | plugins/DbEditorPP/src/copymodule.cpp | 79 |
1 files changed, 21 insertions, 58 deletions
diff --git a/plugins/DbEditorPP/src/copymodule.cpp b/plugins/DbEditorPP/src/copymodule.cpp index 4bc2b21f4c..28ee01a696 100644 --- a/plugins/DbEditorPP/src/copymodule.cpp +++ b/plugins/DbEditorPP/src/copymodule.cpp @@ -65,68 +65,35 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara }
// contacts name
- if (UOS)
- {
- DBVARIANT dbv ={0};
- WCHAR nick[256];
- WCHAR protoW[256]; // unicode proto
+ DBVARIANT dbv ={0};
+ WCHAR nick[256];
+ WCHAR protoW[256]; // unicode proto
- if (szProto[0])
- a2u(szProto, protoW, SIZEOF(protoW));
- else
- protoW[0] = 0;
+ if (szProto[0])
+ a2u(szProto, protoW, SIZEOF(protoW));
+ else
+ protoW[0] = 0;
- if (!szProto[0] || !loaded)
- {
- if (protoW)
- {
- if (Order)
- mir_snwprintf(nick, SIZEOF(nick), L"(%s) %s %s", protoW, GetContactName(hContact, szProto, 1), L"(UNLOADED)");
- else
- mir_snwprintf(nick, SIZEOF(nick), L"%s (%s) %s", GetContactName(hContact, szProto, 1), protoW, L"(UNLOADED)");
- }
- else
- wcscpy(nick, nick_unknownW);
- }
- else
- {
+ if (!szProto[0] || !loaded) {
+ if (protoW) {
if (Order)
- mir_snwprintf(nick, SIZEOF(nick), L"(%s) %s", protoW, GetContactName(hContact, szProto, 1));
+ mir_snwprintf(nick, SIZEOF(nick), L"(%s) %s %s", protoW, GetContactName(hContact, szProto, 1), L"(UNLOADED)");
else
- mir_snwprintf(nick, SIZEOF(nick), L"%s (%s)", GetContactName(hContact, szProto, 1), protoW);
+ mir_snwprintf(nick, SIZEOF(nick), L"%s (%s) %s", GetContactName(hContact, szProto, 1), protoW, L"(UNLOADED)");
}
-
- index = SendMessageW(GetDlgItem(hwnd, IDC_CONTACTS), CB_ADDSTRING, 0, (LPARAM)nick);
- SendMessageW(GetDlgItem(hwnd, IDC_CONTACTS), CB_SETITEMDATA, index, (LPARAM)hContact);
+ else
+ wcscpy(nick, nick_unknownW);
}
- else
- {
- char nick[256];
-
- if (!szProto[0] || !loaded)
- {
- if (szProto[0])
- {
- if (Order)
- mir_snprintf(nick, SIZEOF(nick), "(%s) %s %s", szProto, (char*)GetContactName(hContact, szProto, 0), "(UNLOADED)");
- else
- mir_snprintf(nick, SIZEOF(nick), "%s (%s) %s", (char*)GetContactName(hContact, szProto, 0), szProto, "(UNLOADED)");
- }
- else
- strcpy(nick, nick_unknown);
- }
+ else {
+ if (Order)
+ mir_snwprintf(nick, SIZEOF(nick), L"(%s) %s", protoW, GetContactName(hContact, szProto, 1));
else
- {
- if (Order)
- mir_snprintf(nick, SIZEOF(nick), "(%s) %s", szProto, (char*)GetContactName(hContact, szProto, 0));
- else
- mir_snprintf(nick, SIZEOF(nick), "%s (%s)", (char*)GetContactName(hContact, szProto, 0), szProto);
- }
-
- index = SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_ADDSTRING, 0, (LPARAM)nick);
- SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_SETITEMDATA, index, (LPARAM)hContact);
+ mir_snwprintf(nick, SIZEOF(nick), L"%s (%s)", GetContactName(hContact, szProto, 1), protoW);
}
+ index = SendMessageW(GetDlgItem(hwnd, IDC_CONTACTS), CB_ADDSTRING, 0, (LPARAM)nick);
+ SendMessageW(GetDlgItem(hwnd, IDC_CONTACTS), CB_SETITEMDATA, index, (LPARAM)hContact);
+
hContact = db_find_next(hContact);
}
@@ -185,13 +152,9 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara void copyModuleMenuItem(char* module, HANDLE hContact)
{
- HWND hwnd;
ModuleAndContact *mac = (ModuleAndContact *)mir_calloc(sizeof(ModuleAndContact));
mac->hContact = hContact;
strncpy(mac->module, module, 255);
- if (UOS)
- hwnd = CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_COPY_MOD), 0, copyModDlgProc, (LPARAM)mac);
- else
- hwnd = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_COPY_MOD), 0, copyModDlgProc, (LPARAM)mac);
+ CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_COPY_MOD), 0, copyModDlgProc, (LPARAM)mac);
}
\ No newline at end of file |