summaryrefslogtreecommitdiff
path: root/plugins/ChangeKeyboardLayout/src/text_operations.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-15 21:47:10 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-15 21:47:10 +0000
commit9d482ed81c2a6a3361a5a9b2d0efbfc4b6b815c5 (patch)
treee5b304c159f7c79ab44926eee439eb93288acec6 /plugins/ChangeKeyboardLayout/src/text_operations.cpp
parent7fe6e93058f0e9253e2a79d7fc2d7a136784f791 (diff)
- POPUPDATAT_V2 replaced with POPUPDATAT in all possible cases;
- fix: wrong popup initialization code; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@4057 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/ChangeKeyboardLayout/src/text_operations.cpp')
-rw-r--r--plugins/ChangeKeyboardLayout/src/text_operations.cpp24
1 files changed, 8 insertions, 16 deletions
diff --git a/plugins/ChangeKeyboardLayout/src/text_operations.cpp b/plugins/ChangeKeyboardLayout/src/text_operations.cpp
index f35610625a..a7c00aa4ea 100644
--- a/plugins/ChangeKeyboardLayout/src/text_operations.cpp
+++ b/plugins/ChangeKeyboardLayout/src/text_operations.cpp
@@ -268,8 +268,6 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
EDITSTREAM esStream = {0};
struct EditStreamData esdData;
- POPUPDATAT_V2 pdtData;
-
esStream.dwCookie = (DWORD)&esdData;
esStream.pfnCallback = EditStreamOutRtf;
@@ -524,17 +522,16 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
if (moOptions.CopyToClipboard)
CopyTextToClipboard(ptszMBox);
//-------------------------------Покажем попапы------------------------------------------
- if (moOptions.ShowPopup)
- {
+ if (moOptions.ShowPopup) {
ptszPopupText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(TCHAR));
_tcscpy(ptszPopupText, ptszMBox);
+ POPUPDATAT_V2 pdtData = { 0 };
pdtData.cbSize = sizeof(POPUPDATAT_V2);
- ZeroMemory(&pdtData, sizeof(pdtData));
_tcsncpy(pdtData.lptzContactName, TranslateT(ModuleName), MAX_CONTACTNAME);
_tcsncpy(pdtData.lptzText, ptszPopupText, MAX_SECONDLINE);
- switch(poOptions.bColourType)
- {
+
+ switch(poOptions.bColourType) {
case PPC_POPUP:
pdtData.colorBack = pdtData.colorText = 0;
break;
@@ -546,11 +543,9 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
pdtData.colorBack = poOptions.crBackColour;
pdtData.colorText = poOptions.crTextColour;
break;
- default:
- break;
}
- switch(poOptions.bTimeoutType)
- {
+
+ switch(poOptions.bTimeoutType) {
case PPT_POPUP:
pdtData.iSeconds = 0;
break;
@@ -562,22 +557,19 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord)
break;
}
pdtData.PluginData = ptszPopupText;
+ pdtData.PluginWindowProc = (WNDPROC)CKLPopupDlgProc;
pdtData.lchIcon = hPopupIcon;
poOptions.paActions[0].lchIcon = hCopyIcon;
pdtData.lpActions = poOptions.paActions;
pdtData.actionCount = 1;
-
- pdtData.PluginWindowProc = (WNDPROC)CKLPopupDlgProc;
- if (CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &pdtData, APF_NEWDATA)<0)
- {
+ if ( CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &pdtData, APF_NEWDATA) < 0) {
mir_free(ptszPopupText);
MessageBox(NULL, ptszMBox, TranslateT(ModuleName), MB_ICONINFORMATION);
}
}
mir_free(ptszMBox);
-
}
//------------------Редактируемые поля ----------------------------
else