summaryrefslogtreecommitdiff
path: root/protocols/Gadu-Gadu/src/sessions.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/Gadu-Gadu/src/sessions.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/Gadu-Gadu/src/sessions.cpp')
-rw-r--r--protocols/Gadu-Gadu/src/sessions.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp
index 411730e68d..e9e0205201 100644
--- a/protocols/Gadu-Gadu/src/sessions.cpp
+++ b/protocols/Gadu-Gadu/src/sessions.cpp
@@ -142,7 +142,7 @@ static BOOL IsOverAction(HWND hwndDlg)
szText[0] = 0;
ListView_GetItemText(hList, hti.iItem, hti.iSubItem, szText, SIZEOF(szText));
hdc = GetDC(hList);
- GetTextExtentPoint32(hdc, szText, mir_tstrlen(szText), &textSize);
+ GetTextExtentPoint32(hdc, szText, (int)mir_tstrlen(szText), &textSize);
ReleaseDC(hList, hdc);
textPosX = rc.left + (((rc.right - rc.left) - textSize.cx) / 2);
return (hti.pt.x > textPosX && hti.pt.x < textPosX + textSize.cx);
@@ -241,18 +241,17 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w
: TranslateT("You have to be logged in to view concurrent sessions.");
RECT rc;
HWND hwndHeader = ListView_GetHeader(nm->nmcd.hdr.hwndFrom);
- SIZE textSize;
- int textPosX;
GetClientRect(nm->nmcd.hdr.hwndFrom, &rc);
- if (hwndHeader != NULL)
- {
+ if (hwndHeader != NULL) {
RECT rcHeader;
GetClientRect(hwndHeader, &rcHeader);
rc.top += rcHeader.bottom;
}
- GetTextExtentPoint32(nm->nmcd.hdc, szText, mir_tstrlen(szText), &textSize);
- textPosX = rc.left + (((rc.right - rc.left) - textSize.cx) / 2);
- ExtTextOut(nm->nmcd.hdc, textPosX, rc.top + textSize.cy, ETO_OPAQUE, &rc, szText, mir_tstrlen(szText), NULL);
+ int cbLen = (int)mir_tstrlen(szText);
+ SIZE textSize;
+ GetTextExtentPoint32(nm->nmcd.hdc, szText, cbLen, &textSize);
+ int textPosX = rc.left + (((rc.right - rc.left) - textSize.cx) / 2);
+ ExtTextOut(nm->nmcd.hdc, textPosX, rc.top + textSize.cy, ETO_OPAQUE, &rc, szText, cbLen, NULL);
}
// FALL THROUGH