fixing 37980, r=mjudge

This commit is contained in:
dprice%netscape.com 2000-05-03 03:11:23 +00:00
parent 66d3d1052a
commit 4feedc9725
2 changed files with 24 additions and 0 deletions

View File

@ -171,8 +171,20 @@ nsTextEditorKeyListener::KeyPress(nsIDOMEvent* aKeyEvent)
if (PR_FALSE==keyProcessed)
{
PRUint32 keyCode;
PRUint32 flags;
keyEvent->GetKeyCode(&keyCode);
// if we are readonly or disabled, then do nothing.
if (NS_SUCCEEDED(mEditor->GetFlags(&flags)))
{
if (flags & nsIHTMLEditor::eEditorReadonlyMask ||
flags & nsIHTMLEditor::eEditorDisabledMask)
return NS_OK;
}
else
return NS_ERROR_FAILURE; // Editor unable to handle this.
nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(mEditor);
if (!htmlEditor) return NS_ERROR_NO_INTERFACE;

View File

@ -171,8 +171,20 @@ nsTextEditorKeyListener::KeyPress(nsIDOMEvent* aKeyEvent)
if (PR_FALSE==keyProcessed)
{
PRUint32 keyCode;
PRUint32 flags;
keyEvent->GetKeyCode(&keyCode);
// if we are readonly or disabled, then do nothing.
if (NS_SUCCEEDED(mEditor->GetFlags(&flags)))
{
if (flags & nsIHTMLEditor::eEditorReadonlyMask ||
flags & nsIHTMLEditor::eEditorDisabledMask)
return NS_OK;
}
else
return NS_ERROR_FAILURE; // Editor unable to handle this.
nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(mEditor);
if (!htmlEditor) return NS_ERROR_NO_INTERFACE;