summaryrefslogtreecommitdiff
path: root/plugins/BuddyPounce/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-01-06 13:41:49 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-01-06 13:41:49 +0300
commit27256f195c41e483a12bd1506acbbde5dd1aa3ec (patch)
tree1b3018f641c83883296cc065ca228fca04f4025f /plugins/BuddyPounce/src
parentc8283bbae2f7a24c21c862f1769e8566b0b5144f (diff)
minor code cleaning
Diffstat (limited to 'plugins/BuddyPounce/src')
-rw-r--r--plugins/BuddyPounce/src/dialog.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/plugins/BuddyPounce/src/dialog.cpp b/plugins/BuddyPounce/src/dialog.cpp
index d4fc86a852..129f8504bd 100644
--- a/plugins/BuddyPounce/src/dialog.cpp
+++ b/plugins/BuddyPounce/src/dialog.cpp
@@ -267,25 +267,25 @@ INT_PTR CALLBACK BuddyPounceDlgProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
case IDC_SIMPLE:
case IDOK:
- {
- MCONTACT hContact = (MCONTACT)SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_GETITEMDATA, SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_GETCURSEL, 0, 0), 0);
- int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)) + 1;
- if (length > 1) {
- wchar_t *text = (wchar_t*)mir_alloc(length * sizeof(wchar_t));
- if (!text) {
- msg(TranslateT("Couldn't allocate enough memory"), L"");
- break;
+ {
+ MCONTACT hContact = (MCONTACT)SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_GETITEMDATA, SendDlgItemMessage(hwnd, IDC_CONTACTS, CB_GETCURSEL, 0, 0), 0);
+ int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_MESSAGE)) + 1;
+ if (length > 1) {
+ wchar_t *text = (wchar_t *)mir_alloc(length * sizeof(wchar_t));
+ if (!text) {
+ msg(TranslateT("Couldn't allocate enough memory"), L"");
+ break;
+ }
+ GetDlgItemText(hwnd, IDC_MESSAGE, text, length);
+ g_plugin.setWString(hContact, "PounceMsg", text);
+ mir_free(text);
}
- GetDlgItemText(hwnd, IDC_MESSAGE, text, length);
- g_plugin.setWString(hContact, "PounceMsg", text);
- mir_free(text);
+ else g_plugin.delSetting(hContact, "PounceMsg");
+ saveLastSetting(hContact, hwnd);
}
- else g_plugin.delSetting(hContact, "PounceMsg");
- saveLastSetting(hContact, hwnd);
- } // fall through
- if (LOWORD(wParam) == IDC_SIMPLE)
- CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_POUNCE_SIMPLE), nullptr, BuddyPounceSimpleDlgProc, (LPARAM)((windowInfo *)GetWindowLongPtr(hwnd, GWLP_USERDATA))->hContact);
- // fall through
+ if (LOWORD(wParam) == IDC_SIMPLE)
+ CreateDialogParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_POUNCE_SIMPLE), nullptr, BuddyPounceSimpleDlgProc, (LPARAM)((windowInfo *)GetWindowLongPtr(hwnd, GWLP_USERDATA))->hContact);
+ __fallthrough;
case IDCANCEL:
if (wi->SendIfMy) DestroyWindow(wi->SendIfMy);