diff --git a/mozilla/content/xul/content/src/nsXULTreeElement.cpp b/mozilla/content/xul/content/src/nsXULTreeElement.cpp index 96620d23fe2..0103529e707 100644 --- a/mozilla/content/xul/content/src/nsXULTreeElement.cpp +++ b/mozilla/content/xul/content/src/nsXULTreeElement.cpp @@ -303,9 +303,10 @@ nsXULTreeElement::SelectItemRange(nsIDOMXULElement* aStartItem, nsIDOMXULElement nsCOMPtr startItem; if (aStartItem == nsnull) { // Continue the ranged selection based off the first item selected - if (!mSelectionStart) - mSelectionStart = mCurrentItem; - startItem = mSelectionStart; + if (mSelectionStart) + startItem = mSelectionStart; + else + startItem = mCurrentItem; } else startItem = aStartItem; @@ -317,6 +318,8 @@ nsXULTreeElement::SelectItemRange(nsIDOMXULElement* aStartItem, nsIDOMXULElement SetSuppressOnSelect(PR_TRUE); ClearItemSelection(); + mSelectionStart = startItem; + PRInt32 startIndex = 0, endIndex = 0; diff --git a/mozilla/rdf/content/src/nsXULTreeElement.cpp b/mozilla/rdf/content/src/nsXULTreeElement.cpp index 96620d23fe2..0103529e707 100644 --- a/mozilla/rdf/content/src/nsXULTreeElement.cpp +++ b/mozilla/rdf/content/src/nsXULTreeElement.cpp @@ -303,9 +303,10 @@ nsXULTreeElement::SelectItemRange(nsIDOMXULElement* aStartItem, nsIDOMXULElement nsCOMPtr startItem; if (aStartItem == nsnull) { // Continue the ranged selection based off the first item selected - if (!mSelectionStart) - mSelectionStart = mCurrentItem; - startItem = mSelectionStart; + if (mSelectionStart) + startItem = mSelectionStart; + else + startItem = mCurrentItem; } else startItem = aStartItem; @@ -317,6 +318,8 @@ nsXULTreeElement::SelectItemRange(nsIDOMXULElement* aStartItem, nsIDOMXULElement SetSuppressOnSelect(PR_TRUE); ClearItemSelection(); + mSelectionStart = startItem; + PRInt32 startIndex = 0, endIndex = 0;