summaryrefslogtreecommitdiff
path: root/plugins/SMS/src/senddlg.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-06-06 10:23:34 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-06-06 10:23:34 +0000
commit77778c2b9236077c7e79f06aa798affa2f90a1db (patch)
tree84522dfa63e6f5982614e61a0b1ff2467620d441 /plugins/SMS/src/senddlg.cpp
parent70cbc6e77f935b7116c1080033f5d7d5b604b5a7 (diff)
fix for some warnings
git-svn-id: http://svn.miranda-ng.org/main/trunk@14023 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SMS/src/senddlg.cpp')
-rw-r--r--plugins/SMS/src/senddlg.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/plugins/SMS/src/senddlg.cpp b/plugins/SMS/src/senddlg.cpp
index 6f336ecdf9..73b3457cb2 100644
--- a/plugins/SMS/src/senddlg.cpp
+++ b/plugins/SMS/src/senddlg.cpp
@@ -150,8 +150,9 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l
{
SetDlgItemText(hWndDlg,IDC_MESSAGE,tszSign);
- if (DB_SMS_GetByte(NULL,"SignaturePos",SMS_DEFAULT_SIGNATUREPOS)) SendDlgItemMessage(hWndDlg,IDC_MESSAGE,EM_SETSEL,dwSignLen,dwSignLen);
- EnableWindow(GetDlgItem(hWndDlg,IDOK),dwSignLen);
+ if (DB_SMS_GetByte(NULL,"SignaturePos",SMS_DEFAULT_SIGNATUREPOS))
+ SendDlgItemMessage(hWndDlg,IDC_MESSAGE,EM_SETSEL,dwSignLen,dwSignLen);
+ EnableWindow(GetDlgItem(hWndDlg,IDOK), dwSignLen != 0);
}
mir_sntprintf(tszSign,SIZEOF(tszSign),_T("%d/%d"),dwSignLen,GetSMSMessageLenMax(hWndDlg));
@@ -281,16 +282,16 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l
if (psswdWindowData->bMultiple)
{
TVITEM tvi;
- tvi.mask=TVIF_TEXT;
- tvi.hItem=psswdWindowData->hItemSend;
- tvi.pszText=tszPhone;
- tvi.cchTextMax=SIZEOF(tszPhone);
+ tvi.mask = TVIF_TEXT;
+ tvi.hItem = psswdWindowData->hItemSend;
+ tvi.pszText = tszPhone;
+ tvi.cchTextMax = SIZEOF(tszPhone);
TreeView_GetItem(GetDlgItem(hWndDlg,IDC_NUMBERSLIST),&tvi);
- dwPhoneSize=mir_tstrlen(tszPhone);
- }else{
- dwPhoneSize=GetDlgItemText(hWndDlg,IDC_ADDRESS,tszPhone,SIZEOF(tszPhone));
+ dwPhoneSize = mir_tstrlen(tszPhone);
}
- dwMessageSize=GetDlgItemText(hWndDlg,IDC_MESSAGE,lpwszMessage,(dwMessageSize+2));
+ else dwPhoneSize = GetDlgItemText(hWndDlg, IDC_ADDRESS, tszPhone, SIZEOF(tszPhone));
+
+ dwMessageSize=GetDlgItemText(hWndDlg,IDC_MESSAGE,lpwszMessage,(int)dwMessageSize+2);
SendSMSWindowNumberSet(hWndDlg,tszPhone,dwPhoneSize);
StartSmsSend(hWndDlg,SendDlgItemMessage(hWndDlg,IDC_ACCOUNTS,CB_GETCURSEL,0,0),tszPhone,dwPhoneSize,lpwszMessage,dwMessageSize);
MEMFREE(lpwszMessage);
@@ -358,7 +359,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l
LPTSTR lpwszMessage=(LPTSTR)MEMALLOC((dwMessageSize+4)*sizeof(WCHAR));
if (lpwszMessage)
{
- dwMessageSize=GetDlgItemText(hWndDlg,IDC_MESSAGE,lpwszMessage,(dwMessageSize+2));
+ dwMessageSize = GetDlgItemText(hWndDlg, IDC_MESSAGE, lpwszMessage, (int)dwMessageSize+2);
SendSMSWindowNumberSet(hWndDlg,tszPhone,dwPhoneSize);
EnableWindow(GetDlgItem(hWndDlg,IDOK),FALSE);
EnableWindow(GetDlgItem(hWndDlg,IDC_NUMBERSLIST),FALSE);
@@ -392,7 +393,7 @@ INT_PTR CALLBACK SendSmsDlgProc(HWND hWndDlg,UINT message,WPARAM wParam,LPARAM l
TCHAR tszBuff[MAX_PATH];
size_t dwMessageSize=GET_DLG_ITEM_TEXT_LENGTH(hWndDlg,IDC_MESSAGE);
- EnableWindow(GetDlgItem(hWndDlg,IDOK),dwMessageSize);
+ EnableWindow(GetDlgItem(hWndDlg,IDOK), dwMessageSize != 0);
mir_sntprintf(tszBuff, SIZEOF(tszBuff), _T("%d/%d"), dwMessageSize,GetSMSMessageLenMax(hWndDlg));
SetDlgItemText(hWndDlg,IDC_COUNT,tszBuff);
}
@@ -874,7 +875,7 @@ void SendSMSWindowNext(HWND hWndDlg)
if ( !lptszMessage)
return;
- dwMessageSize=GetDlgItemText(hWndDlg,IDC_MESSAGE,lptszMessage,dwMessageSize+2);
+ dwMessageSize = GetDlgItemText(hWndDlg,IDC_MESSAGE, lptszMessage, (int)dwMessageSize+2);
// if (SendSMSWindowNextHItemGet(hWndDlg,SendSMSWindowHItemSendGet(hWndDlg))==NULL) SendSMSWindowMultipleSet(hWndDlg,FALSE);
tvi.mask=TVIF_TEXT;
@@ -1115,8 +1116,9 @@ size_t GetSMSMessageLenMax(HWND hWndDlg)
LPTSTR lptszMessage=(LPTSTR)MEMALLOC(((dwMessageSize+4)*sizeof(TCHAR)));
if (lptszMessage)
{
- dwMessageSize=GetDlgItemText(hWndDlg,IDC_MESSAGE,lptszMessage,(dwMessageSize+2));
- if (dwMessageSize!=WideCharToMultiByte(CP_UTF8,0,lptszMessage,dwMessageSize,NULL,0,NULL,NULL)) dwLenght=70;
+ dwMessageSize = GetDlgItemText(hWndDlg, IDC_MESSAGE, lptszMessage, (int)dwMessageSize+2);
+ if (dwMessageSize != WideCharToMultiByte(CP_UTF8, 0, lptszMessage, (int)dwMessageSize, NULL, 0, NULL, NULL))
+ dwLenght = 70;
MEMFREE(lptszMessage);
}
return(dwLenght);