mFrame->GetText(&curValue,PR_FALSE);
mFrame->GetText(&curValue);
nsTextInputListener::KeyPress(nsIDOMEvent* aKeyEvent){  if (!mFrame)    return NS_OK;  nsCOMPtr<nsIDOMKeyEvent>keyEvent;  keyEvent = do_QueryInterface(aKeyEvent);  if (!keyEvent)   {    //non-key event passed to keydown.  bad things.    return NS_OK;  }    nsCOMPtr<nsIPrivateDOMEvent> privateEvent = do_QueryInterface(aKeyEvent);  if(privateEvent)   {    PRBool dispatchStopped;    privateEvent->IsDispatchStopped(&dispatchStopped);    if(dispatchStopped)      return NS_OK;  }  if (mFrame && mFrame->IsSingleLineTextControl())  {    PRUint32     keyCode;    keyEvent->GetKeyCode(&keyCode);    if (nsIDOMKeyEvent::DOM_VK_RETURN==keyCode ||        nsIDOMKeyEvent::DOM_VK_ENTER==keyCode)    {      nsAutoString curValue;      mFrame->GetText(&curValue,PR_FALSE);      // If the text control's contents have changed, fire      // off an onChange().      if (!mFocusedValue.Equals(curValue))      {        mFocusedValue = curValue;        mFrame->CallOnChange();      }      // Now try to submit the form. Be sure to check mFrame again      // since CallOnChange() may have caused the deletion of mFrame.      if (mFrame)        mFrame->SubmitAttempt();    }  }  return NS_OK;}