Bug #227206 --> add support for autocompleting a set of comma delimted names in mail compose.

Part of the work to support names from excel spreadsheets directly into the mail compose envelope and have them
get autocompleted.

sr=bienvenu
This commit is contained in:
scott%scott-macgregor.org 2004-01-06 22:04:31 +00:00
parent 4edbb63c73
commit 546ed45ec7
2 changed files with 6 additions and 1 deletions

View File

@ -734,9 +734,12 @@ NS_IMETHODIMP nsAbAutoCompleteSession::OnStartLookup(const PRUnichar *uSearchStr
mAutoCompleteCommentColumn = 0;
}
// strings with @ signs or commas (commas denote multiple names) should be ignored for
// autocomplete purposes
PRInt32 i;
for (i = nsCRT::strlen(uSearchString) - 1; i >= 0; i --)
if (uSearchString[i] == '@')
if (uSearchString[i] == '@' || uSearchString[i] == ',')
{
listener->OnAutoComplete(nsnull, nsIAutoCompleteStatus::ignored);
return NS_OK;

View File

@ -116,6 +116,8 @@ nsLDAPAutoCompleteSession::OnStartLookup(const PRUnichar *searchString,
if (searchString[0] == 0 ||
nsDependentString(searchString).FindChar(PRUnichar('@'), 0) !=
kNotFound ||
nsDependentString(searchString).FindChar(PRUnichar(','), 0) !=
kNotFound ||
( !IS_CJK_CHAR_FOR_LDAP(searchString[0]) ?
mMinStringLength && nsCRT::strlen(searchString) < mMinStringLength :
mCjkMinStringLength && nsCRT::strlen(searchString) <