Commit 9a635804 authored by mcafee%netscape.com's avatar mcafee%netscape.com
Browse files

Adding do_QueryInterface() wrapper for nsCOMPtr carpool. r=scc a=sar

parent 2e33fd0c
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -185,7 +185,7 @@ nsresult nsContentIterator::Init(nsIDOMRange* aRange)
  aRange->GetStartParent(getter_AddRefs(dN));
  if (!dN) 
    return NS_ERROR_ILLEGAL_VALUE;
  cN = dN;
  cN = do_QueryInterface(dN);
  if (!cN) 
    return NS_ERROR_FAILURE;
  
@@ -232,7 +232,7 @@ nsresult nsContentIterator::Init(nsIDOMRange* aRange)
  aRange->GetEndParent(getter_AddRefs(dN));
  if (!dN) 
    return NS_ERROR_ILLEGAL_VALUE;
  cN = dN;
  cN = do_QueryInterface(dN);
  if (!cN) 
    return NS_ERROR_FAILURE;

@@ -507,7 +507,7 @@ nsresult nsContentSubtreeIterator::Init(nsIDOMRange* aRange)
  aRange->GetStartParent(getter_AddRefs(dN));
  if (!dN) 
    return NS_ERROR_ILLEGAL_VALUE;
  cN = dN;
  cN = do_QueryInterface(dN);
  if (!cN) 
    return NS_ERROR_FAILURE;
  
@@ -572,7 +572,7 @@ nsresult nsContentSubtreeIterator::Init(nsIDOMRange* aRange)
  aRange->GetEndParent(getter_AddRefs(dN));
  if (!dN) 
    return NS_ERROR_ILLEGAL_VALUE;
  cN = dN;
  cN = do_QueryInterface(dN);
  if (!cN) 
    return NS_ERROR_FAILURE;

+2 −2
Original line number Diff line number Diff line
@@ -501,8 +501,8 @@ nsGenericDOMDataNode::ConvertContentToXIF(nsXIFConverter& aConverter) const

          nsCOMPtr<nsIContent> startContent;
          nsCOMPtr<nsIContent> endContent;
          startContent = startNode;
          endContent = endNode;
          startContent = do_QueryInterface(startNode);
          endContent = do_QueryInterface(endNode);


          nsString  buffer;
+3 −3
Original line number Diff line number Diff line
@@ -218,7 +218,7 @@ PRBool GetNodeBracketPoints(nsIContent* aNode,
    // end of the root node, becasue it has no parent.
    // so instead represent it by (node,0) and (node,numChildren)
    *outParent = aNode;
    nsCOMPtr<nsIContent> cN(*outParent);
    nsCOMPtr<nsIContent> cN(do_QueryInterface(*outParent));
    if (!cN)
      return false;
    cN->ChildCount(indx);
@@ -229,7 +229,7 @@ PRBool GetNodeBracketPoints(nsIContent* aNode,
  }
  else
  {
    nsCOMPtr<nsIContent> cN(*outParent);
    nsCOMPtr<nsIContent> cN(do_QueryInterface(*outParent));
    if (!NS_SUCCEEDED(cN->IndexOf(aNode, indx)))
      return false;
    *outStartOffset = indx;
@@ -1251,7 +1251,7 @@ nsRange::CloneSibsAndParents(nsCOMPtr<nsIDOMNode> parentNode, PRInt32 nodeOffset
  // Make clone of parent:
  if (parentNode == commonParent || !parentNode)
  {
    parentClone = docfrag;
    parentClone = do_QueryInterface(docfrag);
  }
  else
  {
+2 −2
Original line number Diff line number Diff line
@@ -255,14 +255,14 @@ void nsCaret::DrawCaret()
			domSelection->GetFocusNodeAndOffset(getter_doesnt_AddRef(focusNode), &focusOffset);
			
			// is this a text node?
			nsCOMPtr<nsIDOMCharacterData>	nodeAsText(focusNode);
			nsCOMPtr<nsIDOMCharacterData>	nodeAsText(do_QueryInterface(focusNode));
			if (nodeAsText)
			{
				PRInt32 contentOffset = focusOffset;
				
				if (focusNode)
				{
		      nsCOMPtr<nsIContent>contentNode(focusNode);
		      nsCOMPtr<nsIContent>contentNode(do_QueryInterface(focusNode));
		      
					if (contentNode)
					{
+2 −2
Original line number Diff line number Diff line
@@ -255,14 +255,14 @@ void nsCaret::DrawCaret()
			domSelection->GetFocusNodeAndOffset(getter_doesnt_AddRef(focusNode), &focusOffset);
			
			// is this a text node?
			nsCOMPtr<nsIDOMCharacterData>	nodeAsText(focusNode);
			nsCOMPtr<nsIDOMCharacterData>	nodeAsText(do_QueryInterface(focusNode));
			if (nodeAsText)
			{
				PRInt32 contentOffset = focusOffset;
				
				if (focusNode)
				{
		      nsCOMPtr<nsIContent>contentNode(focusNode);
		      nsCOMPtr<nsIContent>contentNode(do_QueryInterface(focusNode));
		      
					if (contentNode)
					{
Loading