From 9e16855ea08d7bfb28705907ddd3c58cc5143bfd Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Wed, 6 Jun 2001 10:41:17 +0000 Subject: [PATCH] The selectedindex is now getting set to -1 when there are no more items selected and it is sending onchange events by clearing the mOldSelectedIndex. Bug 68135 r=kmcclusk sr=attinasi a=dbaron --- layout/forms/nsListControlFrame.cpp | 23 +++++++++++++++++++- layout/html/forms/src/nsListControlFrame.cpp | 23 +++++++++++++++++++- 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp index d58630a32b2b..7ba87a60ff13 100644 --- a/layout/forms/nsListControlFrame.cpp +++ b/layout/forms/nsListControlFrame.cpp @@ -1303,9 +1303,30 @@ nsListControlFrame::MultipleSelection(PRBool aIsShift, PRBool aIsControl) } } } else if (aIsControl) { - // Control is held down + // Control is held down if (IsContentSelectedByIndex(mSelectedIndex)) { SetContentSelected(mSelectedIndex, PR_FALSE); + // after clearing the selected item + // we need to check to see if there are any more + // selected items + PRInt32 i; + PRInt32 max = 0; + if (NS_SUCCEEDED(GetNumberOfOptions(&max))) { + for (i=0;i