summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src/jabber_form.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-12-02 21:55:57 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-12-02 21:55:57 +0000
commit0ca0de7698b523effaaf6cc9c608e936fa5aaf86 (patch)
tree1e6ce038dc27a1ccddb5e3f863607c83eece2e98 /protocols/JabberG/src/jabber_form.cpp
parentaeae01dc50a5adea8fe003c8195540b1f2b2169f (diff)
useless calls of mir_*strlen in DrawText replaced with -1
git-svn-id: http://svn.miranda-ng.org/main/trunk@11223 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_form.cpp')
-rw-r--r--protocols/JabberG/src/jabber_form.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp
index 86dae77ec8..7afa2152b4 100644
--- a/protocols/JabberG/src/jabber_form.cpp
+++ b/protocols/JabberG/src/jabber_form.cpp
@@ -116,11 +116,12 @@ void JabberFormSetInstruction(HWND hwndForm, const TCHAR *text)
{
if (!text) text = _T("");
- int len = mir_tstrlen(text);
- int fixedLen = len;
+ size_t len = mir_tstrlen(text);
+ size_t fixedLen = len;
for (int i = 1; i < len; i++)
if ((text[i - 1] == _T('\n')) && (text[i] != _T('\r')))
++fixedLen;
+
TCHAR *fixedText = NULL;
if (fixedLen != len) {
fixedText = (TCHAR *)mir_alloc(sizeof(TCHAR) * (fixedLen+1));
@@ -147,7 +148,7 @@ void JabberFormSetInstruction(HWND hwndForm, const TCHAR *text)
SetRect(&rcText, 0, 0, rcText.right-rcText.left, 0);
HDC hdcEdit = GetDC(GetDlgItem(hwndForm, IDC_INSTRUCTION));
HFONT hfntSave = (HFONT)SelectObject(hdcEdit, (HFONT)SendDlgItemMessage(hwndForm, IDC_INSTRUCTION, WM_GETFONT, 0, 0));
- DrawTextEx(hdcEdit, (TCHAR *)text, mir_tstrlen(text), &rcText,
+ DrawTextEx(hdcEdit, (TCHAR *)text, (int)mir_tstrlen(text), &rcText,
DT_CALCRECT|DT_EDITCONTROL|DT_TOP|DT_WORDBREAK, NULL);
SelectObject(hdcEdit, hfntSave);
ReleaseDC(GetDlgItem(hwndForm, IDC_INSTRUCTION), hdcEdit);