Fix problem with autocomplete, bug 14281

This commit is contained in:
ducarroz%netscape.com 1999-09-22 01:37:43 +00:00
Родитель ee2e476427
Коммит fa82fdf0e7
4 изменённых файлов: 12 добавлений и 14 удалений

Просмотреть файл

@ -21,6 +21,6 @@
[scriptable, uuid(CA2A6B08-3625-11d3-988E-001083010E9B)]
interface nsIAutoCompleteListener : nsISupports {
void OnAutoCompleteResult(in wstring aDocId, in wstring aOriginalString, in wstring aMatch);
void OnAutoCompleteResult(in nsISupports aParam, in wstring aOriginalString, in wstring aMatch);
};

Просмотреть файл

@ -23,6 +23,6 @@ interface nsIAutoCompleteListener;
[scriptable, uuid(CA2A6B07-3625-11d3-988E-001083010E9B)]
interface nsIAutoCompleteSession : nsISupports {
void AutoComplete(in wstring doc_id, in wstring aSearchString, in nsIAutoCompleteListener aResultListener);
void AutoComplete(in nsISupports aParam, in wstring aSearchString, in nsIAutoCompleteListener aResultListener);
};

Просмотреть файл

@ -116,7 +116,7 @@ nsresult nsAbAutoCompleteSession::PopulateTableWithAB(nsIEnumerator * aABCards)
break;
}
return rv;
return NS_OK;
}
nsresult nsAbAutoCompleteSession::InitializeTable()
@ -168,7 +168,7 @@ nsAbAutoCompleteSession::~nsAbAutoCompleteSession()
}
}
NS_IMETHODIMP nsAbAutoCompleteSession::AutoComplete(const PRUnichar *aDocId, const PRUnichar *aSearchString, nsIAutoCompleteListener *aResultListener)
NS_IMETHODIMP nsAbAutoCompleteSession::AutoComplete(nsISupports *aParam, const PRUnichar *aSearchString, nsIAutoCompleteListener *aResultListener)
{
// mscott - right now I'm not even going to bother to make this synchronous...
// I'll beef it up with some test data later but we want to see if this idea works for right now...
@ -204,7 +204,7 @@ NS_IMETHODIMP nsAbAutoCompleteSession::AutoComplete(const PRUnichar *aDocId, con
m_searchNameCompletionEntryTable[nIndex].emailAddress, &fullAddress);
nsString searchResult(fullAddress);
// iterate over the table looking for a match
rv = aResultListener->OnAutoCompleteResult(aDocId, aSearchString, searchResult.GetUnicode());
rv = aResultListener->OnAutoCompleteResult(aParam, aSearchString, searchResult.GetUnicode());
break;
}
}
@ -217,7 +217,7 @@ NS_IMETHODIMP nsAbAutoCompleteSession::AutoComplete(const PRUnichar *aDocId, con
if (atSignIndex < 0)
{
searchResult += m_domain;
rv = aResultListener->OnAutoCompleteResult(aDocId, aSearchString, searchResult.GetUnicode());
rv = aResultListener->OnAutoCompleteResult(aParam, aSearchString, searchResult.GetUnicode());
}
}
}

Просмотреть файл

@ -1,16 +1,14 @@
var AddressAutoCompleteListener = {
OnAutoCompleteResult: function(doc_id, aOriginalString, aMatch) {
dump("textId = " + doc_id + "\n");
OnAutoCompleteResult: function(aItem, aOriginalString, aMatch) {
dump("aItem = " + aItem + "\n");
var field = document.getElementById(doc_id);
if ( field )
if ( aItem )
{
dump("value = " + field.value + "\n");
dump("value = " + aItem.value + "\n");
dump("aOriginalString = " + aOriginalString + "\n");
dump("aMatch = " + aMatch + "\n");
field.value = aMatch;
aItem.value = aMatch;
}
}
};
@ -41,5 +39,5 @@ function AutoCompleteAddress(inputElement)
ac = ac.QueryInterface(Components.interfaces.nsIAutoCompleteSession);
}
ac.AutoComplete(inputElement.getAttribute('id'), inputElement.value, AddressAutoCompleteListener);
ac.AutoComplete(inputElement, inputElement.value, AddressAutoCompleteListener);
}