When asked for the selected item string it return first the value, then the label then the content in that order if any are empty
git-svn-id: svn://10.0.0.236/trunk@46859 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -973,6 +973,17 @@ nsListControlFrame::Init(nsIPresContext& aPresContext,
|
||||
reciever->AddEventListenerByIID((nsIDOMMouseMotionListener *)this, kIDOMMouseMotionListenerIID);
|
||||
reciever->AddEventListenerByIID((nsIDOMKeyListener *)this, kIDOMKeyListenerIID);
|
||||
|
||||
#if 0
|
||||
nsIFrame* parent;
|
||||
GetParentWithView(&parent);
|
||||
NS_ASSERTION(parent, "GetParentWithView failed");
|
||||
|
||||
// Get parent view
|
||||
nsIView* parentView = nsnull;
|
||||
while (1) {
|
||||
parent->GetView(&parentView);
|
||||
}
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1449,10 +1460,16 @@ nsListControlFrame::GetSelectedItem(nsString & aStr)
|
||||
nsIDOMHTMLOptionElement* optionElement = GetOption(*options, selectedIndex);
|
||||
if (nsnull != optionElement) {
|
||||
nsAutoString text;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == optionElement->GetText(text)) {
|
||||
rv = optionElement->GetLabel(text);
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE != rv || 0 == text.Length()) {
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == optionElement->GetText(text)) {
|
||||
aStr = text;
|
||||
rv = NS_OK;
|
||||
}
|
||||
} else {
|
||||
aStr = text;
|
||||
rv = NS_OK;
|
||||
}
|
||||
}
|
||||
NS_RELEASE(optionElement);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -973,6 +973,17 @@ nsListControlFrame::Init(nsIPresContext& aPresContext,
|
||||
reciever->AddEventListenerByIID((nsIDOMMouseMotionListener *)this, kIDOMMouseMotionListenerIID);
|
||||
reciever->AddEventListenerByIID((nsIDOMKeyListener *)this, kIDOMKeyListenerIID);
|
||||
|
||||
#if 0
|
||||
nsIFrame* parent;
|
||||
GetParentWithView(&parent);
|
||||
NS_ASSERTION(parent, "GetParentWithView failed");
|
||||
|
||||
// Get parent view
|
||||
nsIView* parentView = nsnull;
|
||||
while (1) {
|
||||
parent->GetView(&parentView);
|
||||
}
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1449,10 +1460,16 @@ nsListControlFrame::GetSelectedItem(nsString & aStr)
|
||||
nsIDOMHTMLOptionElement* optionElement = GetOption(*options, selectedIndex);
|
||||
if (nsnull != optionElement) {
|
||||
nsAutoString text;
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == optionElement->GetText(text)) {
|
||||
rv = optionElement->GetLabel(text);
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE != rv || 0 == text.Length()) {
|
||||
if (NS_CONTENT_ATTR_HAS_VALUE == optionElement->GetText(text)) {
|
||||
aStr = text;
|
||||
rv = NS_OK;
|
||||
}
|
||||
} else {
|
||||
aStr = text;
|
||||
rv = NS_OK;
|
||||
}
|
||||
}
|
||||
NS_RELEASE(optionElement);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user