mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Fixed options to have their text stripped of junk and whitespace compressed before creating the widget
This commit is contained in:
parent
f1a935eb02
commit
dcc388075e
@ -131,9 +131,11 @@ public:
|
||||
virtual PRBool GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
|
||||
nsString* aValues, nsString* aNames);
|
||||
|
||||
PRBool GetContent(nsString& aString) const;
|
||||
virtual PRBool GetContent(nsString& aString) const;
|
||||
|
||||
void SetContent(const nsString& aValue);
|
||||
virtual void SetContent(const nsString& aValue);
|
||||
|
||||
void CompressContent();
|
||||
|
||||
protected:
|
||||
virtual ~nsOption();
|
||||
@ -223,6 +225,7 @@ nsSelectFrame::GetDesiredSize(nsIPresContext* aPresContext,
|
||||
PRInt32 numChildren = select->ChildCount();
|
||||
for (int i = 0; i < numChildren; i++) {
|
||||
nsOption* option = (nsOption*) select->ChildAt(i); // YYY this had better be an option
|
||||
option->CompressContent();
|
||||
nsString text;
|
||||
if (PR_FALSE == option->GetContent(text)) {
|
||||
continue;
|
||||
@ -571,6 +574,14 @@ void nsOption::SetContent(const nsString& aString)
|
||||
*mContent = aString;
|
||||
}
|
||||
|
||||
void
|
||||
nsOption::CompressContent()
|
||||
{
|
||||
if (nsnull != mContent) {
|
||||
mContent->CompressWhitespace(PR_TRUE, PR_TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsOption::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
|
||||
nsString* aValues, nsString* aNames)
|
||||
|
Loading…
Reference in New Issue
Block a user