do not do TypedText if the character code is 0. r=brade. Fix bug 16570 and 16811

This commit is contained in:
ftang%netscape.com 1999-10-20 21:01:20 +00:00
parent 85ff159494
commit b00215d892
2 changed files with 16 additions and 12 deletions

View File

@ -618,12 +618,14 @@ NS_IMETHODIMP nsHTMLEditor::EditorKeyPress(nsIDOMUIEvent* aKeyEvent)
}
else // normal typing
{
if ((PR_FALSE==altKey) && (PR_FALSE==ctrlKey)
&& (PR_FALSE==isShift) && (PR_FALSE==metaKey))
{
nsAutoString key(character);
return TypedText(key, eTypedText);
}
if(0 != character) {
if ((PR_FALSE==altKey) && (PR_FALSE==ctrlKey)
&& (PR_FALSE==isShift) && (PR_FALSE==metaKey))
{
nsAutoString key(character);
return TypedText(key, eTypedText);
}
}
}
}
return NS_ERROR_FAILURE;

View File

@ -618,12 +618,14 @@ NS_IMETHODIMP nsHTMLEditor::EditorKeyPress(nsIDOMUIEvent* aKeyEvent)
}
else // normal typing
{
if ((PR_FALSE==altKey) && (PR_FALSE==ctrlKey)
&& (PR_FALSE==isShift) && (PR_FALSE==metaKey))
{
nsAutoString key(character);
return TypedText(key, eTypedText);
}
if(0 != character) {
if ((PR_FALSE==altKey) && (PR_FALSE==ctrlKey)
&& (PR_FALSE==isShift) && (PR_FALSE==metaKey))
{
nsAutoString key(character);
return TypedText(key, eTypedText);
}
}
}
}
return NS_ERROR_FAILURE;