fix for bug 5782 - check for null return when getting prev/next node is deletion rules; rvd floppy moose, appr chofmann

This commit is contained in:
jfrancis%netscape.com 1999-05-01 19:37:50 +00:00
Родитель 61ec76503b
Коммит 7fb20b8fe5
2 изменённых файлов: 30 добавлений и 6 удалений

Просмотреть файл

@ -367,6 +367,13 @@ nsHTMLEditRules::WillDeleteSelection(nsIDOMSelection *aSelection, nsIEditor::Dir
res = GetPriorNode(node, getter_AddRefs(priorNode));
if (NS_FAILED(res)) return res;
// if there is no prior node then cancel the deletion
if (!priorNode)
{
*aCancel = PR_TRUE;
return res;
}
// XXX hackery - using this to skip empty text nodes,
// since these are almost always non displayed preservation
// of returns in the original html. but they could
@ -423,9 +430,14 @@ nsHTMLEditRules::WillDeleteSelection(nsIDOMSelection *aSelection, nsIEditor::Dir
nsCOMPtr<nsIDOMNode> nextNode;
res = GetNextNode(node, getter_AddRefs(nextNode));
if (NS_FAILED(res)) return res;
if (HasSameBlockNodeParent(node, nextNode)) return NS_OK;
// deleting across blocks
// if there is no next node then cancel the deletion
if (!nextNode)
{
*aCancel = PR_TRUE;
return res;
}
// XXX hackery - using this to skip empty text nodes,
// since these are almost always non displayed preservation
// of returns in the original html. but they could

Просмотреть файл

@ -367,6 +367,13 @@ nsHTMLEditRules::WillDeleteSelection(nsIDOMSelection *aSelection, nsIEditor::Dir
res = GetPriorNode(node, getter_AddRefs(priorNode));
if (NS_FAILED(res)) return res;
// if there is no prior node then cancel the deletion
if (!priorNode)
{
*aCancel = PR_TRUE;
return res;
}
// XXX hackery - using this to skip empty text nodes,
// since these are almost always non displayed preservation
// of returns in the original html. but they could
@ -423,9 +430,14 @@ nsHTMLEditRules::WillDeleteSelection(nsIDOMSelection *aSelection, nsIEditor::Dir
nsCOMPtr<nsIDOMNode> nextNode;
res = GetNextNode(node, getter_AddRefs(nextNode));
if (NS_FAILED(res)) return res;
if (HasSameBlockNodeParent(node, nextNode)) return NS_OK;
// deleting across blocks
// if there is no next node then cancel the deletion
if (!nextNode)
{
*aCancel = PR_TRUE;
return res;
}
// XXX hackery - using this to skip empty text nodes,
// since these are almost always non displayed preservation
// of returns in the original html. but they could