diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2013-01-10 21:24:23 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2013-01-10 21:24:23 +0000 |
commit | d5ab74fb069fe2e95879c8d9cf21602727f4cacd (patch) | |
tree | a76bd088945dc18ce8f6b7be8150fd2de271e58c /plugins | |
parent | f937089c8de3d44ea42103d2a9be7d940f8f6436 (diff) |
Fixed "Sort alphabetically"
git-svn-id: http://svn.miranda-ng.org/main/trunk@3042 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/MetaContacts/src/addto.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/MetaContacts/src/addto.cpp b/plugins/MetaContacts/src/addto.cpp index 058be6394c..3828d04d85 100644 --- a/plugins/MetaContacts/src/addto.cpp +++ b/plugins/MetaContacts/src/addto.cpp @@ -67,19 +67,20 @@ int FillList(HWND list, BOOL sort) if (_tcslen(swzContactDisplayName) > 1023)
swzContactDisplayName[1024] = 0;
- int index;
+ int pos = -1;
if (sort) {
+ pos = 0;
for (int j = 0; j < i; j++) {
TCHAR buff[1024];
SendMessage(list, LB_GETTEXT, j, (LPARAM)buff);
if ( _tcscmp(buff, swzContactDisplayName) > 0) {
- index = SendMessage(list, LB_INSERTSTRING, j, (LPARAM)swzContactDisplayName);
+ pos = j;
break;
}
}
}
- else index = SendMessage(list, LB_INSERTSTRING, (WPARAM)-1, (LPARAM)swzContactDisplayName);
+ int index = SendMessage(list, LB_INSERTSTRING, (WPARAM)pos, (LPARAM)swzContactDisplayName);
SendMessage(list, LB_SETITEMDATA, index, (LPARAM)hMetaUser);
i++;
|