From 07aa970cd8f43ddd9c7b90e3ccec9113a147b79c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 9 Jan 2014 20:42:42 +0000 Subject: code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@7572 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Scriver/src/input.cpp | 44 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 23 deletions(-) (limited to 'plugins/Scriver/src/input.cpp') diff --git a/plugins/Scriver/src/input.cpp b/plugins/Scriver/src/input.cpp index 994fc37e71..c79f4e7b1b 100644 --- a/plugins/Scriver/src/input.cpp +++ b/plugins/Scriver/src/input.cpp @@ -29,8 +29,8 @@ enum KB_ACTIONS {KB_PREV_TAB = 1, KB_NEXT_TAB, KB_SWITCHTOOLBAR, KB_SWITCHSTATUSBAR, KB_SWITCHTITLEBAR, KB_SWITCHINFOBAR, KB_MINIMIZE, KB_CLOSE, KB_CLEAR_LOG, KB_TAB1, KB_TAB2, KB_TAB3, KB_TAB4, KB_TAB5, KB_TAB6, KB_TAB7, KB_TAB8, KB_TAB9, KB_SEND_ALL, KB_PASTESEND, KB_QUOTE}; -void InputAreaContextMenu(HWND hwnd, WPARAM wParam, LPARAM lParam, HANDLE hContact) { - +void InputAreaContextMenu(HWND hwnd, WPARAM wParam, LPARAM lParam, HANDLE hContact) +{ HMENU hMenu, hSubMenu; POINT pt; CHARRANGE sel, all = { 0, -1 }; @@ -46,12 +46,12 @@ void InputAreaContextMenu(HWND hwnd, WPARAM wParam, LPARAM lParam, HANDLE hConta EnableMenuItem(hSubMenu, IDM_COPY, MF_BYCOMMAND | MF_GRAYED); EnableMenuItem(hSubMenu, IDM_DELETE, MF_BYCOMMAND | MF_GRAYED); } - if (!SendMessage(hwnd, EM_CANUNDO, 0, 0)) { + if (!SendMessage(hwnd, EM_CANUNDO, 0, 0)) EnableMenuItem(hSubMenu, IDM_UNDO, MF_BYCOMMAND | MF_GRAYED); - } - if (!SendMessage(hwnd, EM_CANREDO, 0, 0)) { + + if (!SendMessage(hwnd, EM_CANREDO, 0, 0)) EnableMenuItem(hSubMenu, IDM_REDO, MF_BYCOMMAND | MF_GRAYED); - } + if (!SendMessage(hwnd, EM_CANPASTE, 0, 0)) { EnableMenuItem(hSubMenu, IDM_PASTESEND, MF_BYCOMMAND | MF_GRAYED); if (!IsClipboardFormatAvailable(CF_HDROP)) @@ -214,26 +214,26 @@ int InputAreaShortcuts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, Common } if (cmdListNew != NULL) { char *textBuffer; - if (windowData->flags & CWDF_RTF_INPUT) { + if (windowData->flags & CWDF_RTF_INPUT) textBuffer = GetRichTextRTF(hwnd); - } else { + else textBuffer = GetRichTextEncoded(hwnd, windowData->codePage); - } + if (textBuffer != NULL) { windowData->cmdList = tcmdlist_append(windowData->cmdList, textBuffer, 20, TRUE); mir_free(textBuffer); } } - } else if (windowData->cmdListCurrent->prev != NULL) { - cmdListNew = windowData->cmdListCurrent->prev; } - } else { + else if (windowData->cmdListCurrent->prev != NULL) + cmdListNew = windowData->cmdListCurrent->prev; + } + else { if (windowData->cmdListCurrent != NULL) { - if (windowData->cmdListCurrent->next != NULL) { + if (windowData->cmdListCurrent->next != NULL) cmdListNew = windowData->cmdListCurrent->next; - } else if (!windowData->cmdListCurrent->temporary) { + else if (!windowData->cmdListCurrent->temporary) SetWindowText(hwnd, _T("")); - } } } if (cmdListNew != NULL) { @@ -266,21 +266,19 @@ int InputAreaShortcuts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, Common } break; case WM_SYSKEYUP: - { - if ((wParam == VK_LEFT) && isAlt) - return 0; + if ((wParam == VK_LEFT) && isAlt) + return 0; - if ((wParam == VK_RIGHT) && isAlt) - return 0; - } + if ((wParam == VK_RIGHT) && isAlt) + return 0; break; } return -1; } -void RegisterKeyBindings() { - +void RegisterKeyBindings() +{ char strDesc[64], strName[64]; HOTKEYDESC desc = {sizeof(desc) }; desc.pszSection = LPGEN("Messaging"); -- cgit v1.2.3