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:
rods%netscape.com 1999-09-08 19:57:24 +00:00
parent 5438f03f78
commit 39f9de7ab3
2 changed files with 18 additions and 2 deletions

View File

@ -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;

View File

@ -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;