diff options
Diffstat (limited to 'plugins/MetaContacts/src')
-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++;
|