return CopyStringToClipboard(anchorText);
nsCOMPtr<nsIClipboardHelper> clipboard(do_GetService("@mozilla.org/widget/clipboardhelper;1", &rv)); NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_TRUE(clipboard, NS_ERROR_FAILURE);   return clipboard->CopyString(anchorText);
NS_IMETHODIMP PresShell::DoCopyLinkLocation(nsIDOMNode* aNode){#ifdef DEBUG_dr  printf("dr :: PresShell::DoCopyLinkLocation\n");#endif  NS_ENSURE_ARG_POINTER(aNode);  nsresult rv;  // are we an anchor?  nsCOMPtr<nsIDOMHTMLAnchorElement> anchor(do_QueryInterface(aNode, &rv));  NS_ENSURE_SUCCESS(rv, rv);  if (anchor) {    // if so, copy the link:    nsAutoString anchorText;    rv = anchor->GetHref(anchorText);    NS_ENSURE_SUCCESS(rv, rv);    return CopyStringToClipboard(anchorText);  }  // if no link, fail.  return NS_ERROR_FAILURE;}