Back to index

lightning-sunbird  0.9+nobinonly
Static Public Member Functions
nsEditorUtils Class Reference

#include <nsEditorUtils.h>

List of all members.

Static Public Member Functions

static PRBool IsDescendantOf (nsIDOMNode *aNode, nsIDOMNode *aParent, PRInt32 *aOffset=0)
static PRBool IsLeafNode (nsIDOMNode *aNode)

Detailed Description

Definition at line 261 of file nsEditorUtils.h.

Member Function Documentation

PRBool nsEditorUtils::IsDescendantOf ( nsIDOMNode aNode,
nsIDOMNode aParent,
PRInt32 aOffset = 0 
) [static]

Definition at line 194 of file nsEditorUtils.cpp.

  if (!aNode && !aParent) return PR_FALSE;
  if (aNode == aParent) return PR_FALSE;
  nsCOMPtr<nsIDOMNode> parent, node = do_QueryInterface(aNode);
  nsresult res;
    res = node->GetParentNode(getter_AddRefs(parent));
    if (NS_FAILED(res)) return PR_FALSE;
    if (parent == aParent) 
      if (aOffset)
        nsCOMPtr<nsIContent> pCon(do_QueryInterface(parent));
        nsCOMPtr<nsIContent> cCon(do_QueryInterface(node));
        if (pCon)
          *aOffset = pCon->IndexOf(cCon);
      return PR_TRUE;
    node = parent;
  } while (parent);
  return PR_FALSE;

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 226 of file nsEditorUtils.cpp.

  PRBool hasChildren = PR_FALSE;
  if (aNode)
  return !hasChildren;

Here is the caller graph for this function:

The documentation for this class was generated from the following files: