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/watchedvars.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/watchedvars.cpp')
-rw-r--r-- | plugins/DbEditorPP/src/watchedvars.cpp | 73 |
1 files changed, 32 insertions, 41 deletions
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp index 1e315451b8..2bd929209c 100644 --- a/plugins/DbEditorPP/src/watchedvars.cpp +++ b/plugins/DbEditorPP/src/watchedvars.cpp @@ -70,23 +70,19 @@ void addwatchtolist(HWND hwnd2list, struct DBsetting *lParam) if (!hContact)
lvItem.pszText = "NULL";
else
- lvItem.pszText = (char*)GetContactName(hContact,NULL,UOS);
+ lvItem.pszText = (char*)GetContactName(hContact, NULL, 1);
index = ListView_InsertItem(hwnd2list,&lvItem);
- if (UOS)
- {
- WCHAR* ptszText = mir_a2u(lvItem.pszText);
- ListView_SetItemTextW(hwnd2list, index, 0, ptszText);
- mir_free(ptszText);
- }
+ WCHAR* ptszText = mir_a2u(lvItem.pszText);
+ ListView_SetItemTextW(hwnd2list, index, 0, ptszText);
+ mir_free(ptszText);
ListView_SetItemText(hwnd2list,index,1,module);
ListView_SetItemText(hwnd2list,index,2,setting);
- switch (dbv->type)
- {
- case DBVT_BLOB:
+ switch (dbv->type) {
+ case DBVT_BLOB:
{
int j;
char *data = NULL;
@@ -104,42 +100,37 @@ void addwatchtolist(HWND hwnd2list, struct DBsetting *lParam) mir_free(data);
}
break;
- case DBVT_BYTE:
- mir_snprintf(data, 32, "0x%02X (%s)", dbv->bVal, itoa(dbv->bVal,tmp,10));
- ListView_SetItemText(hwnd2list,index,4,data);
- ListView_SetItemText(hwnd2list,index,3,"BYTE");
- break;
- case DBVT_WORD:
- mir_snprintf(data, 32, "0x%04X (%s)", dbv->wVal, itoa(dbv->wVal,tmp,10));
- ListView_SetItemText(hwnd2list,index,4,data);
- ListView_SetItemText(hwnd2list,index,3,"WORD");
+
+ case DBVT_BYTE:
+ mir_snprintf(data, 32, "0x%02X (%s)", dbv->bVal, itoa(dbv->bVal,tmp,10));
+ ListView_SetItemText(hwnd2list,index,4,data);
+ ListView_SetItemText(hwnd2list,index,3,"BYTE");
break;
- case DBVT_DWORD:
- mir_snprintf(data, 32, "0x%08X (%s)", dbv->dVal, itoa(dbv->dVal,tmp,10));
- ListView_SetItemText(hwnd2list,index,4,data);
- ListView_SetItemText(hwnd2list,index,3,"DWORD");
+
+ case DBVT_WORD:
+ mir_snprintf(data, 32, "0x%04X (%s)", dbv->wVal, itoa(dbv->wVal,tmp,10));
+ ListView_SetItemText(hwnd2list,index,4,data);
+ ListView_SetItemText(hwnd2list,index,3,"WORD");
break;
- case DBVT_ASCIIZ:
- ListView_SetItemText(hwnd2list,index,4,dbv->pszVal);
- ListView_SetItemText(hwnd2list,index,3,"STRING");
+
+ case DBVT_DWORD:
+ mir_snprintf(data, 32, "0x%08X (%s)", dbv->dVal, itoa(dbv->dVal,tmp,10));
+ ListView_SetItemText(hwnd2list,index,4,data);
+ ListView_SetItemText(hwnd2list,index,3,"DWORD");
break;
- case DBVT_UTF8:
- {
- if (UOS)
- {
- int length = (int)strlen(dbv->pszVal) + 1;
- WCHAR *wc = (WCHAR*)_alloca(length*sizeof(WCHAR));
- MultiByteToWideChar(CP_UTF8, 0, dbv->pszVal, -1, wc, length);
- ListView_SetItemTextW(hwnd2list,index,4,wc);
- }
- else {
- // convert from UTF8
- ListView_SetItemText(hwnd2list,index,4,dbv->pszVal);
- }
- ListView_SetItemText(hwnd2list,index,3,"UNICODE");
- }
+
+ case DBVT_ASCIIZ:
+ ListView_SetItemText(hwnd2list,index,4,dbv->pszVal);
+ ListView_SetItemText(hwnd2list,index,3,"STRING");
break;
+ case DBVT_UTF8:
+ int length = (int)strlen(dbv->pszVal) + 1;
+ WCHAR *wc = (WCHAR*)_alloca(length*sizeof(WCHAR));
+ MultiByteToWideChar(CP_UTF8, 0, dbv->pszVal, -1, wc, length);
+ ListView_SetItemTextW(hwnd2list,index,4,wc);
+ ListView_SetItemText(hwnd2list,index,3,"UNICODE");
+ break;
}
}
|