return rv;
return NS_OK;
nsTextFrame::GetContentAndOffsetsForSelection(nsIPresContext *aPresContext, nsIContent **aContent, PRInt32 *aOffset, PRInt32 *aLength){  if (!aContent || !aOffset || !aLength)    return NS_ERROR_NULL_POINTER;  //ARE WE GENERATED??  *aContent = nsnull;  *aOffset = mContentOffset;  *aLength = mContentLength;  nsIFrame *parent = GetParent();  if (parent)  {    if ((mState & NS_FRAME_GENERATED_CONTENT) != 0)//parent is generated so so are we.    {      //we COULD check the previous sibling but I dont think that is reliable      *aContent = parent->GetContent();      if(!*aContent)        return NS_ERROR_FAILURE;      NS_ADDREF(*aContent);      //ARE WE A BEFORE FRAME? if not then we assume we are an after frame. this may be bad later      nsIFrame *grandParent = parent->GetParent();      if (grandParent)      {	nsIFrame *firstParent;        nsresult rv = grandParent->FirstChild(aPresContext,nsnull, &firstParent);        if (NS_SUCCEEDED(rv) && firstParent)        {          *aLength = 0;          if (firstParent == parent) //then our parent is the first child of granddad. use BEFORE          {            *aOffset = 0;          }          else          {            *aOffset = (*aContent)->GetChildCount();          }        }        else          return rv;      }    }  }  //END GENERATED BLOCK   if (!*aContent)  {    *aContent = mContent;    NS_IF_ADDREF(*aContent);  }  return NS_OK;}