Logo Search packages:      
Sourcecode: firefox-3.5 version File versions  Download package

nsresult nsEditor::GetChildOffset ( nsIDOMNode aChild,
nsIDOMNode aParent,
PRInt32 &  aOffset 
) [static, inherited]

Set aOffset to the offset of aChild in aParent. Returns an error if aChild is not an immediate child of aParent.

Definition at line 3261 of file nsEditor.cpp.

Referenced by nsEditor::GetNodeLocation().

  NS_ASSERTION((aChild && aParent), "bad args");

  nsCOMPtr<nsIContent> content = do_QueryInterface(aParent);
  nsCOMPtr<nsIContent> cChild = do_QueryInterface(aChild);
  if (!cChild || !content)

  aOffset = content->IndexOf(cChild);

  return NS_OK;

Generated by  Doxygen 1.6.0   Back to index