From 907116c051e995a6a593743c7a6dfdece747c2c0 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 16 Feb 2014 12:44:38 +0000 Subject: code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@8133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/WebView/src/webview_alerts.cpp | 48 ++++++++++++++++----------------- plugins/WebView/src/webview_datawnd.cpp | 12 ++++----- plugins/WebView/src/webview_getdata.cpp | 14 +++++----- plugins/WebView/src/webview_opts.cpp | 2 +- 4 files changed, 38 insertions(+), 38 deletions(-) (limited to 'plugins/WebView') diff --git a/plugins/WebView/src/webview_alerts.cpp b/plugins/WebView/src/webview_alerts.cpp index 21c6037a62..21062d72bb 100644 --- a/plugins/WebView/src/webview_alerts.cpp +++ b/plugins/WebView/src/webview_alerts.cpp @@ -153,12 +153,12 @@ int WPopupAlert(WPARAM wParam, LPARAM lParam) } /*****************************************************************************/ -int PopupAlert(WPARAM wParam, LPARAM lParam) +int PopupAlert(WPARAM hContact, LPARAM lParam) { POPUPDATA ppd = { 0 }; - if (((HANDLE)wParam) != NULL) { + if (hContact != NULL) { DBVARIANT dbv; - if ( !db_get_s(wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { + if (!db_get_s(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { lstrcpynA(ppd.lptzContactName, dbv.pszVal, SIZEOF(ppd.lptzContactName)); db_free(&dbv); } @@ -166,7 +166,7 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) if (ppd.lptzContactName[0] == 0) strncpy_s(ppd.lptzContactName, SIZEOF(ppd.lptzContactName), MODULENAME, _TRUNCATE); - ppd.lchContact = wParam; + ppd.lchContact = hContact; ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SITE)); char *displaytext = (char*)lParam; @@ -198,14 +198,14 @@ int PopupAlert(WPARAM wParam, LPARAM lParam) } /*****************************************************************************/ -int OSDAlert(WPARAM wParam, LPARAM lParam) +int OSDAlert(WPARAM hContact, LPARAM lParam) { char contactname[255], newdisplaytext[2000]; contactname[0] = 0; - if (((HANDLE)wParam) != NULL) { + if (hContact != NULL) { DBVARIANT dbv; - if ( !db_get_s(wParam, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { + if (!db_get_s(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { strncpy_s(contactname, SIZEOF(contactname), dbv.pszVal, _TRUNCATE); db_free(&dbv); } @@ -228,7 +228,7 @@ int ErrorMsgs(WPARAM wParam, LPARAM lParam) MCONTACT hContact = wParam; TCHAR newdisplaytext[2000], *displaytext = (TCHAR*)lParam; - if ( db_get_b(NULL, MODULENAME, SUPPRESS_ERR_KEY, 0)) + if (db_get_b(NULL, MODULENAME, SUPPRESS_ERR_KEY, 0)) return 0; TCHAR *ptszContactName = pcli->pfnGetContactDisplayName(hContact, 0); @@ -264,7 +264,7 @@ void SaveToFile(MCONTACT hContact, char *truncated) char url[300]; url[0] = '\0'; DBVARIANT dbv; - if ( !db_get_s(hContact, MODULENAME, URL_KEY, &dbv)) { + if (!db_get_s(hContact, MODULENAME, URL_KEY, &dbv)) { strncpy_s(url, SIZEOF(url), dbv.pszVal, _TRUNCATE); db_free(&dbv); } @@ -327,10 +327,10 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn ZeroMemory(&cachecompare, sizeof(cachecompare)); // alerts - if ( db_get_b(hContact, MODULENAME, ENABLE_ALERTS_KEY, 0)) { // ALERTS + if (db_get_b(hContact, MODULENAME, ENABLE_ALERTS_KEY, 0)) { // ALERTS alertIndex = db_get_b(hContact, MODULENAME, ALRT_INDEX_KEY, 0); eventIndex = db_get_b(hContact, MODULENAME, EVNT_INDEX_KEY, 0); - if ((notpresent)) { + if (notpresent) { if (alertIndex == 0) { // Popup Sleep(1000); WAlertPopup(hContact, TranslateT("Start/end strings not found or strings not set.")); @@ -339,10 +339,10 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn db_set_s(hContact, "CList", "MyHandle", tstr); } else if (alertIndex == 1) { // log to file - if ( !db_get_s(hContact, MODULENAME, FILE_KEY, &tdbv)) { + if (!db_get_s(hContact, MODULENAME, FILE_KEY, &tdbv)) { int AmountWspcRem = 0; - if ( !db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) { + if (!db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) { CodetoSymbol(tempraw); Sleep(100); // avoid 100% CPU @@ -374,7 +374,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn } else if (alertIndex == 3) { WAlertOSD(hContact, TranslateT("Alert start/end strings not found or strings not set.")); - if ( db_get_b(hContact, MODULENAME, APND_DATE_NAME_KEY, 0)) + if (db_get_b(hContact, MODULENAME, APND_DATE_NAME_KEY, 0)) db_set_s(hContact, "CList", "MyHandle", tstr); } else if (eventIndex == 2) { @@ -391,7 +391,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn } if (eventIndex == 0) { // string present - if ( !db_get_s(hContact, MODULENAME, ALERT_STRING_KEY, &tdbv)) { + if (!db_get_s(hContact, MODULENAME, ALERT_STRING_KEY, &tdbv)) { strncpy_s(alertstring, SIZEOF(alertstring), tdbv.pszVal, _TRUNCATE); db_free(&tdbv); @@ -414,7 +414,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn else if (alertIndex == 1) { if (!db_get_s(hContact, MODULENAME, FILE_KEY, &tdbv)) { int AmountWspcRem = 0; - if ( !db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) { + if (!db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) { CodetoSymbol(tempraw); Sleep(100); // avoid 100% CPU @@ -519,7 +519,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn if (!db_get_s(hContact, MODULENAME, FILE_KEY, &tdbv)) { int AmountWspcRem = 0; - if ( !db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) { + if (!db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) { CodetoSymbol(tempraw); Sleep(100); // avoid 100% CPU @@ -562,11 +562,11 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn if (eventIndex == 2) { // part of webpage changed Alerttempstring[0] = Alerttempstring2[0] = 0; - if ( !db_get_s(hContact, MODULENAME, ALRT_S_STRING_KEY, &tdbv)) { + if (!db_get_s(hContact, MODULENAME, ALRT_S_STRING_KEY, &tdbv)) { strncpy_s(Alerttempstring, SIZEOF(Alerttempstring), tdbv.pszVal, _TRUNCATE); db_free(&tdbv); } - if ( !db_get_s(hContact, MODULENAME, ALRT_E_STRING_KEY, &tdbv)) { + if (!db_get_s(hContact, MODULENAME, ALRT_E_STRING_KEY, &tdbv)) { strncpy_s(Alerttempstring2, SIZEOF(Alerttempstring2), tdbv.pszVal, _TRUNCATE); db_free(&tdbv); } @@ -623,9 +623,9 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn } else if (alertIndex == 1) { // LOG if (!notpresent) { // dont log to file twice if both types of start/end strings not present - if ( !db_get_s(hContact, MODULENAME, FILE_KEY, &tdbv)) { + if (!db_get_s(hContact, MODULENAME, FILE_KEY, &tdbv)) { int AmountWspcRem = 0; - if ( !db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) { + if (!db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) { CodetoSymbol(tempraw); Sleep(100); // avoid 100% CPU @@ -729,7 +729,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn else if (alertIndex == 1) { // log to file if (!db_get_s(hContact, MODULENAME, FILE_KEY, &tdbv)) { int AmountWspcRem = 0; - if ( !db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) { + if (!db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) { CodetoSymbol(tempraw); Sleep(100); // avoid 100% CPU @@ -779,7 +779,7 @@ int ProcessAlerts(MCONTACT hContact, char *truncated, char *tstr, char *contactn if (!db_get_s(hContact, MODULENAME, FILE_KEY, &tdbv)) { int AmountWspcRem = 0; - if ( !db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) { + if (!db_get_b(hContact, MODULENAME, SAVE_AS_RAW_KEY, 0)) { CodetoSymbol(tempraw); Sleep(100); // avoid 100% CPU @@ -848,7 +848,7 @@ void ReadFromFile(void *param) HWND hwndDlg = WindowList_Find(hWindowList, hContact); char contactname[100]; contactname[0] = 0; - if ( !db_get_s(hContact, "CList", "MyHandle", &dbv)) { + if (!db_get_s(hContact, "CList", "MyHandle", &dbv)) { strncpy_s(contactname, SIZEOF(contactname), dbv.pszVal, _TRUNCATE); db_free(&dbv); } diff --git a/plugins/WebView/src/webview_datawnd.cpp b/plugins/WebView/src/webview_datawnd.cpp index e9d7ae144c..e928b21d6a 100644 --- a/plugins/WebView/src/webview_datawnd.cpp +++ b/plugins/WebView/src/webview_datawnd.cpp @@ -132,7 +132,7 @@ static MCONTACT FindContactByUrl(HWND hwndDlg) ptrT db1( db_get_tsa(hContact, MODULENAME, URL_KEY)); ptrT db2( db_get_tsa(hContact, MODULENAME, PRESERVE_NAME_KEY)); - if ( !lstrcmp(urltext, db1) && !lstrcmp(titlebartxt, db2)) { + if (!lstrcmp(urltext, db1) && !lstrcmp(titlebartxt, db2)) { contactcount++; if (contactcount > 1) { MessageBox(NULL, TranslateT("ERROR: You have two or more Webview contacts with the same URL and contact name."), _T(MODULENAME), MB_OK); @@ -161,14 +161,14 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA WindowList_Add(hWindowList, hwndDlg, hContact2); url[0] = '\0'; - if ( !db_get_ts(hContact2, MODULENAME, URL_KEY, &dbv)) { + if (!db_get_ts(hContact2, MODULENAME, URL_KEY, &dbv)) { _tcsncpy_s(url, SIZEOF(url), dbv.ptszVal, _TRUNCATE); db_free(&dbv); } SetDlgItemText(hwndDlg, IDC_OPEN_URL, FixButtonText(url, SIZEOF(url))); char preservename[100]; - if ( !db_get_s(hContact2, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { + if (!db_get_s(hContact2, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { strncpy_s(preservename, SIZEOF(preservename), dbv.pszVal, _TRUNCATE); db_free(&dbv); } @@ -199,7 +199,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA SendDlgItemMessage(hwndDlg, IDC_OPEN_URL, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Click here to open this URL in a browser window."), BATF_TCHAR); - if ( !db_get_b(hContact2, MODULENAME, ON_TOP_KEY, 0)) { + if (!db_get_b(hContact2, MODULENAME, ON_TOP_KEY, 0)) { SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BM_SETIMAGE, IMAGE_ICON, (LPARAM) LoadImage(hInst, MAKEINTRESOURCE(IDI_UNSTICK), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0)); SendDlgItemMessage(hwndDlg, IDC_STICK_BUTTON, BUTTONADDTOOLTIP, (WPARAM) TranslateT("Stick to the front"), BATF_TCHAR); } @@ -360,7 +360,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA { TCHAR *ptszToolTip; HWND hTopmost; - if ( !db_get_b(hContact, MODULENAME, ON_TOP_KEY, 0)) { + if (!db_get_b(hContact, MODULENAME, ON_TOP_KEY, 0)) { hTopmost = HWND_NOTOPMOST; ptszToolTip = TranslateT("Stick to the front"); } @@ -452,7 +452,7 @@ INT_PTR CALLBACK DlgProcDisplayData(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA break; case WM_MOVE: - if ( !IsIconic(hwndDlg) && !IsZoomed(hwndDlg)) { + if (!IsIconic(hwndDlg) && !IsZoomed(hwndDlg)) { GetWindowRect(hwndDlg, &rc); // global Xposition = rc.left; diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp index 0c885b9012..eef98ee250 100644 --- a/plugins/WebView/src/webview_getdata.cpp +++ b/plugins/WebView/src/webview_getdata.cpp @@ -72,13 +72,13 @@ void GetData(void *param) db_set_b(hContact, MODULENAME, STOP_KEY, 0); if (db_get_s(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { - if ( !db_get_s(hContact, "CList", "MyHandle", &dbv)) { + if (!db_get_s(hContact, "CList", "MyHandle", &dbv)) { db_set_s(hContact, MODULENAME, PRESERVE_NAME_KEY, dbv.pszVal); db_free(&dbv); } } - if ( !db_get_s(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { + if (!db_get_s(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) { strncpy_s(contactname, SIZEOF(contactname), dbv.pszVal, _TRUNCATE); db_free(&dbv); } @@ -88,17 +88,17 @@ void GetData(void *param) if (!Startingup) db_set_b(NULL, MODULENAME, HAS_CRASHED_KEY, 1); - if ( !db_get_s(hContact, MODULENAME, START_STRING_KEY, &dbv)) { + if (!db_get_s(hContact, MODULENAME, START_STRING_KEY, &dbv)) { strncpy_s(tempstring, SIZEOF(tempstring), dbv.pszVal, _TRUNCATE); db_free(&dbv); } - if ( !db_get_s(hContact, MODULENAME, END_STRING_KEY, &dbv)) { + if (!db_get_s(hContact, MODULENAME, END_STRING_KEY, &dbv)) { strncpy_s(tempstring2, SIZEOF(tempstring2), dbv.pszVal, _TRUNCATE); db_free(&dbv); } - if ( !db_get_s(hContact, MODULENAME, URL_KEY, &dbv)) { + if (!db_get_s(hContact, MODULENAME, URL_KEY, &dbv)) { strncpy_s(url, SIZEOF(url), dbv.pszVal, _TRUNCATE); db_free(&dbv); } @@ -349,11 +349,11 @@ void GetData(void *param) strncpy(buff, truncated, SIZEOF(buff)); Filter(buff); - if ( !db_get_s(hContact, MODULENAME, ALRT_S_STRING_KEY, &dbv)) { + if (!db_get_s(hContact, MODULENAME, ALRT_S_STRING_KEY, &dbv)) { strncpy_s(Alerttempstring, SIZEOF(Alerttempstring), dbv.pszVal, _TRUNCATE); db_free(&dbv); } - if ( !db_get_s(hContact, MODULENAME, ALRT_E_STRING_KEY, &dbv)) { + if (!db_get_s(hContact, MODULENAME, ALRT_E_STRING_KEY, &dbv)) { strncpy_s(Alerttempstring2, SIZEOF(Alerttempstring2), dbv.pszVal, _TRUNCATE); db_free(&dbv); } diff --git a/plugins/WebView/src/webview_opts.cpp b/plugins/WebView/src/webview_opts.cpp index 14f776003b..fe02eb5d21 100644 --- a/plugins/WebView/src/webview_opts.cpp +++ b/plugins/WebView/src/webview_opts.cpp @@ -424,7 +424,7 @@ INT_PTR CALLBACK DlgProcAlertOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l } } - if ( !db_get_ts(hContact, MODULENAME, FILE_KEY, &dbv)) { + if (!db_get_ts(hContact, MODULENAME, FILE_KEY, &dbv)) { SetDlgItemText(hwndDlg, IDC_FILENAME, dbv.ptszVal); db_free(&dbv); } -- cgit v1.2.3