changed the way white space was being compress when getting the value
now a value of all spaces does get compressed to nothing git-svn-id: svn://10.0.0.236/trunk@46388 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
5438f03f78
commit
39f9de7ab3
@ -450,7 +450,15 @@ nsHTMLOptionElement::GetText(nsString& aText)
|
||||
rv = node->QueryInterface(kIDOMTextIID, (void**)&domText);
|
||||
if (NS_SUCCEEDED(rv) && domText) {
|
||||
rv = domText->GetData(aText);
|
||||
aText.CompressWhitespace(PR_TRUE, PR_TRUE);
|
||||
// the option could be all spaces, so compress the white space
|
||||
// then make sure the length is greater than zero
|
||||
if (aText.Length() > 0) {
|
||||
nsAutoString compressText = aText;
|
||||
compressText.CompressWhitespace(PR_TRUE, PR_TRUE);
|
||||
if (compressText.Length() != 0) {
|
||||
aText = compressText;
|
||||
}
|
||||
}
|
||||
NS_RELEASE(domText);
|
||||
NS_RELEASE(node);
|
||||
break;
|
||||
|
||||
@ -450,7 +450,15 @@ nsHTMLOptionElement::GetText(nsString& aText)
|
||||
rv = node->QueryInterface(kIDOMTextIID, (void**)&domText);
|
||||
if (NS_SUCCEEDED(rv) && domText) {
|
||||
rv = domText->GetData(aText);
|
||||
aText.CompressWhitespace(PR_TRUE, PR_TRUE);
|
||||
// the option could be all spaces, so compress the white space
|
||||
// then make sure the length is greater than zero
|
||||
if (aText.Length() > 0) {
|
||||
nsAutoString compressText = aText;
|
||||
compressText.CompressWhitespace(PR_TRUE, PR_TRUE);
|
||||
if (compressText.Length() != 0) {
|
||||
aText = compressText;
|
||||
}
|
||||
}
|
||||
NS_RELEASE(domText);
|
||||
NS_RELEASE(node);
|
||||
break;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user