summaryrefslogtreecommitdiff
path: root/plugins/QuickContacts/src
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 /plugins/QuickContacts/src
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 'plugins/QuickContacts/src')
-rw-r--r--plugins/QuickContacts/src/quickcontacts.cpp33
1 files changed, 10 insertions, 23 deletions
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp
index 3360e861eb..861e899084 100644
--- a/plugins/QuickContacts/src/quickcontacts.cpp
+++ b/plugins/QuickContacts/src/quickcontacts.cpp
@@ -1031,18 +1031,13 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
rc.bottom = rc.top + tm.tmHeight;
// Draw Protocol
- if (opts.num_protos > 1)
- {
- if (max_proto_width == 0)
- {
+ if (opts.num_protos > 1) {
+ if (max_proto_width == 0) {
// Has to be done, else the DC isnt the right one
// Dont ask me why
- for(int loop = 0; loop < contacts.getCount(); loop++)
- {
+ for (int loop = 0; loop < contacts.getCount(); loop++) {
RECT rcc = { 0, 0, 0x7FFF, 0x7FFF };
-
- DrawText(lpdis->hDC, contacts[loop]->proto, mir_tstrlen(contacts[loop]->proto),
- &rcc, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE | DT_CALCRECT);
+ DrawText(lpdis->hDC, contacts[loop]->proto, -1, &rcc, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE | DT_CALCRECT);
max_proto_width = max(max_proto_width, rcc.right - rcc.left);
}
@@ -1056,33 +1051,25 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
}
RECT rc_tmp = rc;
-
rc_tmp.left = rc_tmp.right - max_proto_width;
-
- DrawText(lpdis->hDC, contacts[lpdis->itemData]->proto, mir_tstrlen(contacts[lpdis->itemData]->proto),
- &rc_tmp, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE);
-
+ DrawText(lpdis->hDC, contacts[lpdis->itemData]->proto, -1, &rc_tmp, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE);
rc.right = rc_tmp.left - 5;
}
// Draw group
- if (opts.group_append && opts.group_column)
- {
+ if (opts.group_append && opts.group_column) {
RECT rc_tmp = rc;
- if (opts.group_column_left)
- {
+ if (opts.group_column_left) {
rc_tmp.right = rc_tmp.left + (rc.right - rc.left) / 3;
rc.left = rc_tmp.right + 5;
}
- else
- {
+ else {
rc_tmp.left = rc_tmp.right - (rc.right - rc.left) / 3;
rc.right = rc_tmp.left - 5;
}
- DrawText(lpdis->hDC, contacts[lpdis->itemData]->szgroup, mir_tstrlen(contacts[lpdis->itemData]->szgroup),
- &rc_tmp, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE);
+ DrawText(lpdis->hDC, contacts[lpdis->itemData]->szgroup, -1, &rc_tmp, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE);
}
// Draw text
@@ -1092,7 +1079,7 @@ static INT_PTR CALLBACK MainDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
else
name = contacts[lpdis->itemData]->szname;
- DrawText(lpdis->hDC, name, mir_tstrlen(name), &rc, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE);
+ DrawText(lpdis->hDC, name, -1, &rc, DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE);
// Restore old colors
SetTextColor(lpdis->hDC, clrfore);