fix ldap autocomplete not to append two addresses in certain situations, r=mscott, sr=neil, a=shaver 261272

git-svn-id: svn://10.0.0.236/trunk@173911 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bienvenu%nventure.com
2005-06-01 15:07:04 +00:00
parent e3a98f1f30
commit e29525bec4

View File

@@ -528,7 +528,7 @@
<method name="startLookup">
<body><![CDATA[
var str = this.value;
this.isSearching = true;
this.mSessionReturns = this.sessionCount;
this.mFailureCount = 0;
@@ -711,6 +711,7 @@
if (results && results.items.Count() > 0 && results.defaultItemIndex != -1)
{
this.value = this.getSessionValueAt(name, results.defaultItemIndex);
this.mDefaultMatchFilled = true;
this.mNeedToFinish = false;
break;
}
@@ -728,7 +729,10 @@
this.mNeedToFinish = false;
var defaultSession = this.getDefaultSession();
if (defaultSession)
{
this.value = this.getSessionValueAt(defaultSession, 0); // preselect the first one...
this.mDefaultMatchFilled = true;
}
}
}
@@ -1011,14 +1015,14 @@
<parameter name="aUseFirstMatchIfNoDefault"/>
<body><![CDATA[
if (this.mDefaultMatchFilled) return;
if (!this.mFinishAfterSearch && this.autoFill &&
this.mLastKeyCode != KeyEvent.DOM_VK_BACK_SPACE &&
this.mLastKeyCode != KeyEvent.DOM_VK_DELETE) {
var indexToUse = aResults.defaultItemIndex;
if (aUseFirstMatchIfNoDefault && indexToUse == -1)
indexToUse = 0;
indexToUse = 0;
if (indexToUse != -1) {
var resultValue = this.getSessionValueAt(aSessionName, indexToUse);
var match = resultValue.toLowerCase();