Fix for crasher bugs 37701 and 37728. r=mjudge@netscape.com

This commit is contained in:
kin%netscape.com 2000-05-01 18:21:30 +00:00
parent 104709c453
commit 65b72822ba
3 changed files with 18 additions and 6 deletions

View File

@ -1792,14 +1792,18 @@ nsSelection::GetFrameForNodeOffset(nsIContent *aNode, PRInt32 aOffset, nsIFrame
childIndex = aOffset;
}
result = theNode->ChildAt(childIndex, *getter_AddRefs(theNode));
nsCOMPtr<nsIContent> childNode;
result = theNode->ChildAt(childIndex, *getter_AddRefs(childNode));
if (NS_FAILED(result))
return result;
if (!theNode)
if (!childNode)
return NS_ERROR_FAILURE;
theNode = childNode;
#ifdef DONT_DO_THIS_YET
// XXX: We can't use this code yet because the hinting
// can cause us to attatch to the wrong line frame.

View File

@ -1792,14 +1792,18 @@ nsSelection::GetFrameForNodeOffset(nsIContent *aNode, PRInt32 aOffset, nsIFrame
childIndex = aOffset;
}
result = theNode->ChildAt(childIndex, *getter_AddRefs(theNode));
nsCOMPtr<nsIContent> childNode;
result = theNode->ChildAt(childIndex, *getter_AddRefs(childNode));
if (NS_FAILED(result))
return result;
if (!theNode)
if (!childNode)
return NS_ERROR_FAILURE;
theNode = childNode;
#ifdef DONT_DO_THIS_YET
// XXX: We can't use this code yet because the hinting
// can cause us to attatch to the wrong line frame.

View File

@ -1792,14 +1792,18 @@ nsSelection::GetFrameForNodeOffset(nsIContent *aNode, PRInt32 aOffset, nsIFrame
childIndex = aOffset;
}
result = theNode->ChildAt(childIndex, *getter_AddRefs(theNode));
nsCOMPtr<nsIContent> childNode;
result = theNode->ChildAt(childIndex, *getter_AddRefs(childNode));
if (NS_FAILED(result))
return result;
if (!theNode)
if (!childNode)
return NS_ERROR_FAILURE;
theNode = childNode;
#ifdef DONT_DO_THIS_YET
// XXX: We can't use this code yet because the hinting
// can cause us to attatch to the wrong line frame.