Fixed textfield problems from widget changes.

This commit is contained in:
kostello%netscape.com 1998-09-17 20:07:15 +00:00
parent 94de21e214
commit 3c1d6e4098
2 changed files with 8 additions and 5 deletions

View File

@ -395,7 +395,7 @@ NS_METHOD nsInputFrame::HandleEvent(nsIPresContext& aPresContext,
GetView(view);
if (view) {
nsInput* content = (nsInput *)mContent;
if (content->GetWidgetSupports() != aEvent->widgetSupports) {
if (content->GetWidget() != aEvent->widget) {
aEventStatus = nsEventStatus_eIgnore;
return NS_OK;
}

View File

@ -381,6 +381,9 @@ nsInputText::GetMaxNumValues()
return 1;
}
static NS_DEFINE_IID(kITextWidgetIID, NS_ITEXTWIDGET_IID);
static NS_DEFINE_IID(kITextAreaWidgetIID, NS_ITEXTAREAWIDGET_IID);
PRBool
nsInputText::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
nsString* aValues, nsString* aNames)
@ -392,7 +395,7 @@ nsInputText::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
nsITextWidget* text = nsnull;
nsITextAreaWidget* textArea = nsnull;
if (widget != nsnull && NS_OK == widget->QueryInterface(kTextIID,(void**)text))
if (widget != nsnull && NS_OK == widget->QueryInterface(kITextWidgetIID,(void**)&text))
{
nsString value;
PRUint32 size;
@ -403,7 +406,7 @@ nsInputText::GetNamesValues(PRInt32 aMaxNumValues, PRInt32& aNumValues,
NS_RELEASE(text);
return PR_TRUE;
}
else if (widget != nsnull && NS_OK == widget->QueryInterface(kTextAreaIID,(void**)textArea))
else if (widget != nsnull && NS_OK == widget->QueryInterface(kITextAreaWidgetIID,(void**)&textArea))
{
nsString value;
PRUint32 size;
@ -424,7 +427,7 @@ nsInputText::Reset()
nsIWidget* widget = GetWidget();
nsITextWidget* text = nsnull;
nsITextAreaWidget* textArea = nsnull;
if (widget != nsnull && NS_OK == widget->QueryInterface(kTextIID,(void**)text))
if (widget != nsnull && NS_OK == widget->QueryInterface(kTextIID,(void**)&text))
{
PRUint32 size;
if (nsnull == mValue) {
@ -434,7 +437,7 @@ nsInputText::Reset()
}
NS_RELEASE(text);
}
else if (widget != nsnull && NS_OK == widget->QueryInterface(kTextAreaIID,(void**)textArea))
else if (widget != nsnull && NS_OK == widget->QueryInterface(kTextAreaIID,(void**)&textArea))
{
PRUint32 size;
if (nsnull == mValue) {