mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
fixing 37980, r=mjudge
This commit is contained in:
parent
66d3d1052a
commit
4feedc9725
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user