Bug 16126: Check for a cached state when reading value or submitting Gfx text frame (before initialize); r=joki

This commit is contained in:
pollmann%netscape.com 1999-10-13 02:49:42 +00:00
parent ee28759d13
commit e0ed7d0ee8

View File

@ -357,7 +357,12 @@ nsGfxTextControlFrame::GetText(nsString* aText, PRBool aInitialValue)
mEditor->OutputToString(*aText, format, 0);
}
else {
result = nsFormControlHelper::GetInputElementValue(mContent, aText, aInitialValue);
if (mCachedState) {
*aText = *mCachedState;
result = NS_OK;
} else {
result = nsFormControlHelper::GetInputElementValue(mContent, aText, aInitialValue);
}
}
}
RemoveNewlines(*aText);
@ -665,6 +670,11 @@ void nsGfxTextControlFrame::GetTextControlFrameState(nsString& aValue)
mEditor->OutputToString(aValue, format, flags);
}
else {
if (mCachedState) {
aValue = *mCachedState;
}
}
}
void nsGfxTextControlFrame::SetTextControlFrameState(const nsString& aValue)